test: cover organization administration workflows

This commit is contained in:
2026-07-31 04:21:34 +02:00
parent 06bd1c9003
commit 17ab9c9c8d
2 changed files with 202 additions and 0 deletions
@@ -12,6 +12,14 @@ const styles = readFileSync(
new URL("../src/styles/organizations.css", import.meta.url),
"utf8"
);
const moduleSource = readFileSync(
new URL("../src/module.ts", import.meta.url),
"utf8"
);
const apiSource = readFileSync(
new URL("../src/api/organizations.ts", import.meta.url),
"utf8"
);
assert(source.includes("ExplorerTree,"), "Organizations imports the central ExplorerTree");
assert(source.includes("<ExplorerTree"), "the organization hierarchy uses ExplorerTree");
@@ -22,3 +30,31 @@ assert(!source.includes("renderUnitTreeNodes"), "the custom recursive renderer w
assert(!source.includes("organizations-tree-row"), "the custom tree row was removed");
assert(!source.includes("organizations-tree-node"), "the custom tree node was removed");
assert(!styles.includes("organizations-tree-"), "Organizations no longer owns shared tree styling");
assert(
moduleSource.includes('"admin.sections": organizationAdminSections'),
"organization governance settings use the shared admin layout"
);
for (const operation of [
"createUnit",
"patchUnit",
"createFunction",
"patchFunction"
]) {
assert(
source.includes(operation),
`the organization editor exposes ${operation}`
);
assert(
apiSource.includes(`function ${operation}`),
`the organization API client defines ${operation}`
);
}
assert(
source.includes("is_active: draft.is_active"),
"organization editors persist active and inactive state"
);
assert(
source.includes('id="organizations-units"')
&& source.includes('id="organizations-functions"'),
"unit and function lists use the shared DataGrid"
);