Phase 5 red: collection and file decryption tests

10 tests covering decryptCollection (key + name decryption from raw
server JSON, type mapping, isShared, missing name, wrong key) and
decryptFile (key + metadata decryption, fileType number-to-string
mapping, file/thumbnail header passthrough, wrong key).

Adds src/model/types.ts with both raw (server) and decrypted (library)
type definitions. src/model/decrypt.ts has throwing stubs.
This commit is contained in:
2026-05-13 17:12:46 -07:00
parent ab6e59bd4d
commit f81216333e
4 changed files with 376 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
// Stub: see the README "Development workflow" section for TDD policy.
import type {
Collection,
EnteFile,
RawCollection,
RawEnteFile,
} from "./types.js";
export const decryptCollection = (
_raw: RawCollection,
_masterKey: Uint8Array,
_currentUserID?: number,
): Collection => {
throw new Error("model.decryptCollection not implemented");
};
export const decryptFile = (
_raw: RawEnteFile,
_collectionKey: Uint8Array,
): EnteFile => {
throw new Error("model.decryptFile not implemented");
};