fix: guard recursive section rendering
This commit is contained in:
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" }]);
|
||||||
|
});
|
||||||
|
});
|
||||||
Reference in new issue
Block a user