diff options
| author | Adam Malczewski <[email protected]> | 2026-10-24 17:09:17 +0900 |
|---|---|---|
| committer | Adam Malczewski <[email protected]> | 2026-10-24 17:09:17 +0900 |
| commit | 0ba54b4455cb560cf7a82baf71b31ed129cfc29b (patch) | |
| tree | 424ac806b3822247c0b835ee38ffabdf87f5016e /src/features/tabs/tab-groups.test.ts | |
| parent | 83442d00d9d9c7f0ca200d6a2e8b42195708493f (diff) | |
| download | dispatch-web-0ba54b4455cb560cf7a82baf71b31ed129cfc29b.tar.gz dispatch-web-0ba54b4455cb560cf7a82baf71b31ed129cfc29b.zip | |
fix(tabs): finish accessible cascade confirmation and verify active closes
Diffstat (limited to 'src/features/tabs/tab-groups.test.ts')
| -rw-r--r-- | src/features/tabs/tab-groups.test.ts | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/features/tabs/tab-groups.test.ts b/src/features/tabs/tab-groups.test.ts index 67150ff..46b04e7 100644 --- a/src/features/tabs/tab-groups.test.ts +++ b/src/features/tabs/tab-groups.test.ts @@ -127,6 +127,15 @@ describe("cascadeCloseIds (the ids a cascading tab close removes)", () => { expect(cascadeCloseIds(tabs, "c2")).toEqual(["c2"]); }); + it("matches the rendered forest for cycles and manual regrouping", () => { + const cycle = [tab("p", "c1"), tab("c1", "p"), tab("g", "c1")]; + expect(cascadeCloseIds(cycle, "p")).toEqual(["p"]); + expect(cascadeCloseIds(cycle, "c1")).toEqual(["c1", "g"]); + const regrouped = [tab("p"), tab("c1", "solo"), tab("g", "c1"), tab("solo")]; + expect(cascadeCloseIds(regrouped, "p")).toEqual(["p"]); + expect(cascadeCloseIds(regrouped, "solo")).toEqual(["solo", "c1", "g"]); + }); + it("ignores tabs whose group parent is no longer open", () => { const stale = [tab("p"), tab("orphan", "gone")]; expect(cascadeCloseIds(stale, "p")).toEqual(["p"]); |
