fix: guard recursive section rendering

This commit is contained in:
ajnart committed 2026-08-08 18:24:38 +02:00
1 parent a9fc3c6faa
commit bc41125b7f
4 files changed
+33 -4

No files matched your search

@@ -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" }]);
});
});