fix: guard recursive section rendering

This commit is contained in:
ajnart committed 2026-08-14 11:32:09 +02:00
1 parent 252ce998ae
commit dfcd1dbb64
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" }]);
});
});