fix: accept legacy dynamic sections

This commit is contained in:
Thomas Camlong committed 2026-08-09 18:03:37 +02:00
1 parent 899dfd7230
commit fc1dbd37f1
2 files changed
+15 -3

No files matched your search

+10 -2
View File
@@ -44,8 +44,16 @@ describe("section behavior validation", () => {
});
});
it.each(["category", "dynamic"])("rejects the legacy %s kind", (kind) => {
expect(() => sectionSchema.parse({ id: "legacy", kind, layouts: [] })).toThrow();
it("normalizes the legacy dynamic kind to a container", () => {
expect(sectionSchema.parse({ id: "legacy", kind: "dynamic", layouts: [] })).toMatchObject({
id: "legacy",
kind: "container",
layouts: [],
});
});
it("rejects the legacy category kind", () => {
expect(() => sectionSchema.parse({ id: "legacy", kind: "category", layouts: [] })).toThrow();
});
it.each([