From a0584a68c90376052917628f4e188830ab9a5c3c Mon Sep 17 00:00:00 2001 From: Beaudan Date: Fri, 7 Dec 2018 17:53:34 +1100 Subject: [PATCH] Review suggested test case --- libloki/test/libloki-protocol_test.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libloki/test/libloki-protocol_test.js b/libloki/test/libloki-protocol_test.js index 66496b166..5d0d6d11f 100644 --- a/libloki/test/libloki-protocol_test.js +++ b/libloki/test/libloki-protocol_test.js @@ -26,6 +26,13 @@ describe('FallBackSessionCipher', () => { const { type } = await fallbackCipher.encrypt(buffer); assert.strictEqual(type, textsecure.protobuf.Envelope.Type.FRIEND_REQUEST); }); + + it('should encrypt and then decrypt a message with the same result', async () => { + const arr = new Uint8Array([1,2,3,4,5]); + const { body } = await fallbackCipher.encrypt(arr.buffer); + const result = await fallbackCipher.decrypt(body); + assert.deepEqual(result, arr.buffer); + }); }); describe('LibLoki Protocol', () => {