Files
govoplan-postbox/webui/scripts/test-postbox-page-structure.mjs

30 lines
935 B
JavaScript

import assert from "node:assert/strict";
import { readFileSync } from "node:fs";
const page = readFileSync(
new URL("../src/features/postbox/PostboxPage.tsx", import.meta.url),
"utf8"
);
const admin = readFileSync(
new URL("../src/features/postbox/PostboxAdminPanel.tsx", import.meta.url),
"utf8"
);
const styles = readFileSync(
new URL("../src/styles/postbox.css", import.meta.url),
"utf8"
);
assert.match(page, /postbox-shell/);
assert.match(page, /postbox-directory/);
assert.match(page, /postbox-message-list/);
assert.match(page, /postbox-detail/);
assert.match(page, /postbox\.inbox\.directory/);
assert.match(page, /postbox\.inbox\.messages/);
assert.match(admin, /AdminPageLayout/);
assert.match(admin, /Postbox templates/);
assert.match(admin, /Exact postbox/);
assert.match(styles, /\.postbox-shell\s*\{/);
assert.match(styles, /grid-template-columns:/);
console.log("Postbox WebUI structure checks passed.");