feat: ship enterprise control and desktop governance
This commit is contained in:
23
tests/admin-web-static-route.test.ts
Normal file
23
tests/admin-web-static-route.test.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import test from "node:test";
|
||||
import assert from "node:assert/strict";
|
||||
import { readFile } from "node:fs/promises";
|
||||
|
||||
async function readSource(path: string) {
|
||||
return readFile(new URL(path, import.meta.url), "utf8");
|
||||
}
|
||||
|
||||
test("enterprise admin route gates static Vue admin behind highest_admin", async () => {
|
||||
const source = await readSource("../src/app/enterprise-admin/page.tsx");
|
||||
|
||||
assert.match(source, /requirePageSession/);
|
||||
assert.match(source, /session\.role\s*!==\s*["']highest_admin["']/);
|
||||
assert.match(source, /redirect\(["']\/admin-web\/index\.html["']\)/);
|
||||
});
|
||||
|
||||
test("independent admin build publishes static assets under Next public admin-web", async () => {
|
||||
const source = await readSource("../apps/boss-admin-web/vite.config.ts");
|
||||
|
||||
assert.match(source, /base:\s*["']\/admin-web\/["']/);
|
||||
assert.match(source, /outDir:\s*["']\.\.\/\.\.\/public\/admin-web["']/);
|
||||
assert.match(source, /emptyOutDir:\s*true/);
|
||||
});
|
||||
Reference in New Issue
Block a user