diff --git a/apps/nextjs/src/components/board/sections/gridstack/gridstack.spec.ts b/apps/nextjs/src/components/board/sections/gridstack/gridstack.spec.ts new file mode 100644 index 000000000..3df5c1a38 --- /dev/null +++ b/apps/nextjs/src/components/board/sections/gridstack/gridstack.spec.ts @@ -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" }]); + }); +});