Skip to content

Commit

Permalink
refine test
Browse files Browse the repository at this point in the history
  • Loading branch information
overheadhunter committed May 22, 2024
1 parent 9c3ab12 commit ec4415d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions frontend/test/common/universalVaultFormat.spec.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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 = {
Expand Down Expand Up @@ -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
});
});
});
Expand Down

0 comments on commit ec4415d

Please sign in to comment.