1 import {decrypt, encrypt, encode, decode} from 'utils/Crypto.js';
3 describe('Crypto', () => {
4 it('encrypt and decrypt text properly', () => {
6 const stringToEncrypt = 'textToEncrypt';
9 const encryptedString = encrypt(stringToEncrypt);
12 const decryptedString = decrypt(encryptedString);
13 expect(decryptedString).toBe(stringToEncrypt);
16 it('encode and decode text properly', () => {
18 const stringToEncrypt = 'textToEncode';
21 const encryptedString = encode(stringToEncrypt);
24 const decryptedString = decode(encryptedString);
25 expect(decryptedString).toBe(stringToEncrypt);