28 lines
1.2 KiB
JavaScript
28 lines
1.2 KiB
JavaScript
import assert from "node:assert/strict";
|
|
import { readFileSync } from "node:fs";
|
|
|
|
const moduleSource = readFileSync("src/module.ts", "utf8");
|
|
const panel = readFileSync("src/features/EncryptionAdminPanel.tsx", "utf8");
|
|
const api = readFileSync("src/api/encryption.ts", "utf8");
|
|
|
|
assert.match(moduleSource, /"admin.sections": adminSections/);
|
|
assert.match(moduleSource, /encryption\.admin\.vaults/);
|
|
assert.match(moduleSource, /encryption\.admin\.migrations/);
|
|
assert.match(moduleSource, /encryption\.admin\.recovery/);
|
|
assert.match(panel, /<AdminPageLayout/);
|
|
assert.match(panel, /<DataGrid/);
|
|
assert.match(panel, /<StatusBadge/);
|
|
assert.match(panel, /<TableActionGroup/);
|
|
assert.match(panel, /cannot recall plaintext/);
|
|
assert.match(panel, /distinct custodians/);
|
|
assert.match(panel, /owning module must durably update/);
|
|
assert.match(panel, /Encryption cannot be disabled/);
|
|
assert.doesNotMatch(panel, /provider_key_ref/);
|
|
assert.doesNotMatch(panel, /wrapped_key_refs/);
|
|
assert.doesNotMatch(api, /provider_key_ref/);
|
|
assert.doesNotMatch(api, /wrapped_key_refs/);
|
|
assert.match(api, /expected_revision/);
|
|
assert.match(api, /disable-preflight/);
|
|
|
|
console.log("Encryption administration UI structural contract passed.");
|