fix(housekeeping): harden system workflow boundaries
This commit is contained in:
1 parent
3788ecd9f1
commit
c325c53774
18 files changed
+809
-79
No files matched your search
@@ -21,6 +21,26 @@ const requiredKeys = [
|
||||
"pages.housekeeping.states.error.description",
|
||||
];
|
||||
|
||||
const systemRouteMessageKeys = [
|
||||
"pages.housekeeping.routes.system.access.permissions",
|
||||
"pages.housekeeping.routes.system.access.permission-detail",
|
||||
"pages.housekeeping.routes.system.configuration.settings",
|
||||
"pages.housekeeping.routes.system.configuration.emulator",
|
||||
"pages.housekeeping.routes.system.observability.analytics",
|
||||
"pages.housekeeping.routes.system.observability.analytics-activity",
|
||||
"pages.housekeeping.routes.system.observability.analytics-economy",
|
||||
"pages.housekeeping.routes.system.observability.devops",
|
||||
"pages.housekeeping.routes.system.observability.devops-errors",
|
||||
"pages.housekeeping.routes.system.observability.logs-staff",
|
||||
"pages.housekeeping.routes.system.observability.logs-audit",
|
||||
"pages.housekeeping.routes.system.observability.logs-chat",
|
||||
"pages.housekeeping.routes.system.observability.logs-commands",
|
||||
"pages.housekeeping.routes.system.observability.logs-trades",
|
||||
"pages.housekeeping.routes.system.operations.alerts",
|
||||
"pages.housekeeping.routes.system.operations.command-center",
|
||||
"pages.housekeeping.routes.system.operations.maintenance",
|
||||
] as const;
|
||||
|
||||
const expectedDomainMessages = [
|
||||
{
|
||||
id: "operations",
|
||||
@@ -74,6 +94,7 @@ describe("housekeeping localization contract", () => {
|
||||
"preview",
|
||||
"navigation",
|
||||
"domains",
|
||||
"routes",
|
||||
"states",
|
||||
]);
|
||||
|
||||
@@ -81,6 +102,12 @@ describe("housekeeping localization contract", () => {
|
||||
expect(resolveMessage(messages, key), key).toEqual(expect.any(String));
|
||||
}
|
||||
|
||||
for (const key of systemRouteMessageKeys) {
|
||||
const message = resolveMessage(messages, key);
|
||||
expect(message, key).toEqual(expect.any(String));
|
||||
expect((message as string).trim(), key).not.toBe("");
|
||||
}
|
||||
|
||||
for (const [index, expected] of expectedDomainMessages.entries()) {
|
||||
const manifest = HOUSEKEEPING_MANIFESTS[index];
|
||||
|
||||
|
||||
@@ -19,6 +19,42 @@ const routeMocks = vi.hoisted(() => {
|
||||
"domains.people.description": "Localized People description",
|
||||
"domains.economy.title": "Localized Economy",
|
||||
"domains.economy.description": "Localized Economy description",
|
||||
"domains.operations.title": "Localized Operations",
|
||||
"domains.operations.description": "Localized Operations description",
|
||||
"domains.content.title": "Localized Content",
|
||||
"domains.content.description": "Localized Content description",
|
||||
"domains.hotel.title": "Localized Hotel",
|
||||
"domains.hotel.description": "Localized Hotel description",
|
||||
"domains.system.title": "HK::system-title",
|
||||
"domains.system.description": "Localized System description",
|
||||
"routes.system.access.permissions": "HK::system-access-permissions",
|
||||
"routes.system.access.permission-detail":
|
||||
"HK::system-access-permission-detail",
|
||||
"routes.system.configuration.settings": "HK::system-configuration-settings",
|
||||
"routes.system.configuration.emulator": "HK::system-configuration-emulator",
|
||||
"routes.system.observability.analytics":
|
||||
"HK::system-observability-analytics",
|
||||
"routes.system.observability.analytics-activity":
|
||||
"HK::system-observability-analytics-activity",
|
||||
"routes.system.observability.analytics-economy":
|
||||
"HK::system-observability-analytics-economy",
|
||||
"routes.system.observability.devops": "HK::system-observability-devops",
|
||||
"routes.system.observability.devops-errors":
|
||||
"HK::system-observability-devops-errors",
|
||||
"routes.system.observability.logs-staff":
|
||||
"HK::system-observability-logs-staff",
|
||||
"routes.system.observability.logs-audit":
|
||||
"HK::system-observability-logs-audit",
|
||||
"routes.system.observability.logs-chat":
|
||||
"HK::system-observability-logs-chat",
|
||||
"routes.system.observability.logs-commands":
|
||||
"HK::system-observability-logs-commands",
|
||||
"routes.system.observability.logs-trades":
|
||||
"HK::system-observability-logs-trades",
|
||||
"routes.system.operations.alerts": "HK::system-operations-alerts",
|
||||
"routes.system.operations.command-center":
|
||||
"HK::system-operations-command-center",
|
||||
"routes.system.operations.maintenance": "HK::system-operations-maintenance",
|
||||
"states.empty.title": "Localized empty title",
|
||||
"states.empty.description": "Localized empty description",
|
||||
};
|
||||
@@ -599,6 +635,44 @@ describe("/ase-next/[domain] layout", () => {
|
||||
);
|
||||
expect(routeMocks.getTranslations).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it("builds and translates the complete real System navigation", async () => {
|
||||
routeMocks.getHousekeepingCapabilityContext.mockResolvedValue({
|
||||
...capabilityContext([]),
|
||||
isSuperAdmin: true,
|
||||
});
|
||||
|
||||
const html = await renderRoute(
|
||||
AdminNextDomainLayout({
|
||||
children: createElement("p", null, "System body"),
|
||||
params: Promise.resolve({ domain: "system" }),
|
||||
}),
|
||||
);
|
||||
|
||||
for (const label of [
|
||||
"HK::system-access-permissions",
|
||||
"HK::system-access-permission-detail",
|
||||
"HK::system-configuration-settings",
|
||||
"HK::system-configuration-emulator",
|
||||
"HK::system-observability-analytics",
|
||||
"HK::system-observability-analytics-activity",
|
||||
"HK::system-observability-analytics-economy",
|
||||
"HK::system-observability-devops",
|
||||
"HK::system-observability-devops-errors",
|
||||
"HK::system-observability-logs-staff",
|
||||
"HK::system-observability-logs-audit",
|
||||
"HK::system-observability-logs-chat",
|
||||
"HK::system-observability-logs-commands",
|
||||
"HK::system-observability-logs-trades",
|
||||
"HK::system-operations-alerts",
|
||||
"HK::system-operations-command-center",
|
||||
"HK::system-operations-maintenance",
|
||||
]) {
|
||||
expect(html).toContain(label);
|
||||
}
|
||||
expect(html).toContain("HK::system-title");
|
||||
expect(html).toContain("System body");
|
||||
});
|
||||
});
|
||||
|
||||
describe("/ase-next/[domain]/[[...segments]] page", () => {
|
||||
|
||||
Reference in new issue
Block a user