fix: close housekeeping foundation review findings
This commit is contained in:
@@ -50,6 +50,48 @@ describe("validateMigrationEntries", () => {
|
||||
expect(issues).toContain("REBUILD requires targetPath: /admin");
|
||||
});
|
||||
|
||||
it("rejects a discovery surface mismatch for the same legacy path", () => {
|
||||
expect(
|
||||
validateMigrationEntries(
|
||||
[page("/admin")],
|
||||
[{ ...entry("/admin"), surface: "mod" }],
|
||||
),
|
||||
).toEqual([
|
||||
"surface mismatch for legacyPath /admin: expected admin, received mod",
|
||||
]);
|
||||
});
|
||||
|
||||
it("rejects a discovery source file mismatch for the same legacy path", () => {
|
||||
expect(
|
||||
validateMigrationEntries(
|
||||
[page("/admin")],
|
||||
[
|
||||
{
|
||||
...entry("/admin"),
|
||||
sourceFile: "src/app/admin/renamed/page.tsx",
|
||||
},
|
||||
],
|
||||
),
|
||||
).toEqual([
|
||||
"sourceFile mismatch for legacyPath /admin: expected src/app/admin/page.tsx, received src/app/admin/renamed/page.tsx",
|
||||
]);
|
||||
});
|
||||
|
||||
it("rejects removal with a non-null target", () => {
|
||||
expect(
|
||||
validateMigrationEntries(
|
||||
[page("/admin")],
|
||||
[
|
||||
{
|
||||
...entry("/admin"),
|
||||
decision: "REMOVE",
|
||||
targetPath: "/admin/system/legacy",
|
||||
},
|
||||
],
|
||||
),
|
||||
).toEqual(["REMOVE requires null targetPath: /admin"]);
|
||||
});
|
||||
|
||||
it("enforces migration safety evidence", () => {
|
||||
const issues = validateMigrationEntries(
|
||||
[page("/admin")],
|
||||
|
||||
Reference in New Issue
Block a user