docs: audit housekeeping people workflows
This commit is contained in:
1 parent
a619f89106
commit
eb9f01d6fe
4 files changed
+968
No files matched your search
@@ -0,0 +1,36 @@
|
|||||||
|
import { describe, expect, it } from "vitest";
|
||||||
|
import { PERMS } from "@/lib/permission-slugs";
|
||||||
|
import { operationsMigrationEntries } from "./operations";
|
||||||
|
|
||||||
|
describe("operationsMigrationEntries", () => {
|
||||||
|
it("covers the legacy dashboard once", () => {
|
||||||
|
expect(operationsMigrationEntries).toHaveLength(1);
|
||||||
|
expect(operationsMigrationEntries[0]).toMatchObject({
|
||||||
|
surface: "admin",
|
||||||
|
legacyPath: "/admin",
|
||||||
|
sourceFile: "src/app/admin/page.tsx",
|
||||||
|
targetDomain: "operations",
|
||||||
|
targetPath: "/admin/work",
|
||||||
|
decision: "REBUILD",
|
||||||
|
capabilities: { read: [PERMS.ADMIN_DASHBOARD], mutate: [] },
|
||||||
|
dependencies: {
|
||||||
|
queries: [
|
||||||
|
"users",
|
||||||
|
"active bans",
|
||||||
|
"website articles",
|
||||||
|
"staff activities",
|
||||||
|
],
|
||||||
|
mutations: [],
|
||||||
|
},
|
||||||
|
auditRequirement: "NONE",
|
||||||
|
localization: "COMPLETE",
|
||||||
|
accessibility: "PARTIAL",
|
||||||
|
requiredTests: ["integration", "e2e", "visual"],
|
||||||
|
parityEvidence: [],
|
||||||
|
status: "PLANNED",
|
||||||
|
notes: [
|
||||||
|
"Replace metric dashboard with capability-derived operational home",
|
||||||
|
],
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
import { PERMS } from "@/lib/permission-slugs";
|
||||||
|
import type { MigrationEntry } from "./types";
|
||||||
|
|
||||||
|
export const operationsMigrationEntries: readonly MigrationEntry[] = [
|
||||||
|
{
|
||||||
|
surface: "admin",
|
||||||
|
legacyPath: "/admin",
|
||||||
|
sourceFile: "src/app/admin/page.tsx",
|
||||||
|
targetDomain: "operations",
|
||||||
|
targetPath: "/admin/work",
|
||||||
|
decision: "REBUILD",
|
||||||
|
capabilities: { read: [PERMS.ADMIN_DASHBOARD], mutate: [] },
|
||||||
|
dependencies: {
|
||||||
|
queries: ["users", "active bans", "website articles", "staff activities"],
|
||||||
|
mutations: [],
|
||||||
|
},
|
||||||
|
auditRequirement: "NONE",
|
||||||
|
localization: "COMPLETE",
|
||||||
|
accessibility: "PARTIAL",
|
||||||
|
requiredTests: ["integration", "e2e", "visual"],
|
||||||
|
parityEvidence: [],
|
||||||
|
status: "PLANNED",
|
||||||
|
notes: [
|
||||||
|
"Replace metric dashboard with capability-derived operational home",
|
||||||
|
],
|
||||||
|
},
|
||||||
|
];
|
||||||
@@ -0,0 +1,70 @@
|
|||||||
|
import { describe, expect, it } from "vitest";
|
||||||
|
import { discoverLegacyPages } from "./discover-legacy-pages";
|
||||||
|
import { operationsMigrationEntries } from "./operations";
|
||||||
|
import { peopleMigrationEntries } from "./people";
|
||||||
|
import { validateMigrationEntries } from "./validate-matrix";
|
||||||
|
|
||||||
|
const PEOPLE_PREFIXES = [
|
||||||
|
"/admin/users",
|
||||||
|
"/admin/online",
|
||||||
|
"/admin/guilds",
|
||||||
|
"/admin/applications",
|
||||||
|
"/admin/teams",
|
||||||
|
"/admin/bans",
|
||||||
|
"/admin/ip",
|
||||||
|
"/admin/vpn",
|
||||||
|
"/admin/wordfilter",
|
||||||
|
"/admin/moderation",
|
||||||
|
"/admin/tickets",
|
||||||
|
"/admin/help-tickets",
|
||||||
|
"/mod",
|
||||||
|
] as const;
|
||||||
|
|
||||||
|
describe("peopleMigrationEntries", () => {
|
||||||
|
it("merges every mod page into a people workflow", () => {
|
||||||
|
const modRows = peopleMigrationEntries.filter(
|
||||||
|
(row) => row.surface === "mod",
|
||||||
|
);
|
||||||
|
|
||||||
|
expect(modRows).toHaveLength(13);
|
||||||
|
expect(modRows.every((row) => row.decision === "MERGE")).toBe(true);
|
||||||
|
expect(
|
||||||
|
modRows.every((row) => row.targetPath?.startsWith("/admin/people/")),
|
||||||
|
).toBe(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("merges duplicate user detail and edit aliases", () => {
|
||||||
|
for (const legacyPath of ["/admin/users/:id", "/admin/users/:id/edit"]) {
|
||||||
|
expect(peopleMigrationEntries).toContainEqual(
|
||||||
|
expect.objectContaining({ legacyPath, decision: "MERGE" }),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
it("keeps planned rows free of unverified parity claims", () => {
|
||||||
|
expect(
|
||||||
|
peopleMigrationEntries.every(
|
||||||
|
(row) => row.status === "PLANNED" && row.parityEvidence.length === 0,
|
||||||
|
),
|
||||||
|
).toBe(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("covers every Operations and People legacy page exactly once", () => {
|
||||||
|
const expected = discoverLegacyPages().filter(
|
||||||
|
(page) =>
|
||||||
|
page.legacyPath === "/admin" ||
|
||||||
|
PEOPLE_PREFIXES.some(
|
||||||
|
(prefix) =>
|
||||||
|
page.legacyPath === prefix ||
|
||||||
|
page.legacyPath.startsWith(`${prefix}/`),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
expect(
|
||||||
|
validateMigrationEntries(expected, [
|
||||||
|
...operationsMigrationEntries,
|
||||||
|
...peopleMigrationEntries,
|
||||||
|
]),
|
||||||
|
).toEqual([]);
|
||||||
|
});
|
||||||
|
});
|
||||||
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user