Skip to content

Commit 041a5cc

Browse files
committed
Node and the browser test should be the same
1 parent a8315f4 commit 041a5cc

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

modules/encrypt-node/test/encrypt.test.ts

+9
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,15 @@ describe('encrypt structural testing', () => {
375375
const plaintext = new Uint8Array()
376376
const { result, messageHeader } = await encrypt(keyRing, plaintext)
377377

378+
/* The default algorithm suite will add a signature key to the context.
379+
* So I only check that the passed context elements exist.
380+
*/
381+
expect(messageHeader.encryptionContext)
382+
.to.haveOwnProperty('simple')
383+
.and.to.equal('context')
384+
expect(messageHeader.encryptedDataKeys).lengthOf(1)
385+
expect(messageHeader.encryptedDataKeys[0]).to.deep.equal(edk)
386+
378387
const headerInfo = deserializeMessageHeader(result)
379388
if (!headerInfo) throw new Error('this should never happen')
380389

0 commit comments

Comments
 (0)