fix: guard recursive section rendering

This commit is contained in:
ajnart committed 2026-08-13 19:55:55 +02:00
1 parent aef0a6d340
commit 45954837ed
1 file changed
+11
@@ -0,0 +1,11 @@
import { describe, expect, test } from "vitest";
import { filterRecursiveInnerSections } from "./gridstack";
describe("filterRecursiveInnerSections", () => {
test("removes sections that would recursively render an ancestor", () => {
const innerSections = [{ id: "safe" }, { id: "parent" }, { id: "root" }];
expect(filterRecursiveInnerSections(innerSections, new Set(["root", "parent"]))).toEqual([{ id: "safe" }]);
});
});