diff --git a/frontend/test/common/universalVaultFormat.spec.ts b/frontend/test/common/universalVaultFormat.spec.ts index 06d4f89d..90cdb704 100644 --- a/frontend/test/common/universalVaultFormat.spec.ts +++ b/frontend/test/common/universalVaultFormat.spec.ts @@ -1,5 +1,6 @@ import { use as chaiUse, expect } from 'chai'; import chaiAsPromised from 'chai-as-promised'; +import chaiBytes from 'chai-bytes'; import { before, describe } from 'mocha'; import { base64 } from 'rfc4648'; import { VaultDto } from '../../src/common/backend'; @@ -8,6 +9,7 @@ import { JsonJWE } from '../../src/common/jwe'; import { MemberKey, RecoveryKey, UniversalVaultFormat, VaultMetadata } from '../../src/common/universalVaultFormat'; chaiUse(chaiAsPromised); +chaiUse(chaiBytes); // key coordinates from MDN examples: const alicePublic: JsonWebKey = { @@ -287,6 +289,7 @@ describe('UVF', () => { const rootDirId = base64.parse('24UBEDeGu5taq7U4GqyA0MXUXb9HTYS6p3t9vvHGJAc='); const fileContent = await uvf.encryptFile(rootDirId, uvf.metadata.initialSeedId); expect(fileContent).to.have.a.lengthOf(128); + expect(fileContent.slice(0, 4)).to.equalBytes(new Uint8Array([0x75, 0x76, 0x66, 0x01])); // magic bytes }); }); });