The best way to control Claude Code, Codex and more from any computer or phone
| 1 | import { describe, expect, it } from "vite-plus/test"; |
| 2 | |
| 3 | import { toggleAllDiffFiles } from "./diffCollapse"; |
| 4 | |
| 5 | describe("toggleAllDiffFiles", () => { |
| 6 | it.each([ |
| 7 | { action: "expanding", collapsed: ["a", "b", "hidden"], expected: ["hidden"] }, |
| 8 | { action: "collapsing", collapsed: ["a", "hidden"], expected: ["a", "b", "hidden"] }, |
| 9 | ])( |
| 10 | "keeps a folded file outside the given ones folded when $action", |
| 11 | ({ collapsed, expected }) => { |
| 12 | expect([...toggleAllDiffFiles(["a", "b"], new Set(collapsed))].toSorted()).toEqual(expected); |
| 13 | }, |
| 14 | ); |
| 15 | }); |