Merge "Upversion sparky-fe in master"
[aai/sparky-fe.git] / test / utils / Crypto.test.js
1 import {decrypt, encrypt, encode, decode} from 'utils/Crypto.js';
2
3 describe('Crypto', () => {
4     it('encrypt and decrypt text properly', () => {
5         // given
6         const stringToEncrypt = 'textToEncrypt';
7
8         // when
9         const encryptedString = encrypt(stringToEncrypt);
10
11         // then
12         const decryptedString = decrypt(encryptedString);
13         expect(decryptedString).toBe(stringToEncrypt);
14     });
15
16     it('encode and decode text properly', () => {
17         // given
18         const stringToEncrypt = 'textToEncode';
19
20         // when
21         const encryptedString = encode(stringToEncrypt);
22
23         // then
24         const decryptedString = decode(encryptedString);
25         expect(decryptedString).toBe(stringToEncrypt);
26     });
27
28 });

© 2017 ONAP. Copyright © The Linux Foundation ®. All Rights Reserved.
The Linux Foundation has registered trademarks and uses trademarks.
For a list of trademarks of The Linux Foundation, please see our Trademark Usage page.
Linux is a registered trademark of Linus Torvalds.
Privacy Policy and Terms of Use