test: cover organization administration workflows
This commit is contained in:
@@ -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"
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user