feat(tui): collapse directories when possible in file tree (#28512)
This commit is contained in:
@@ -89,8 +89,8 @@ describe("DiffViewerFileTree", () => {
|
||||
await renderFrame(() => <DiffViewerFileTree files={files} loading={false} error={undefined} theme={theme} />),
|
||||
)
|
||||
|
||||
expect(focused).toContain("▾ src")
|
||||
expect(unfocused).toContain("▾ src")
|
||||
expect(focused).toContain("▾ src/config")
|
||||
expect(unfocused).toContain("▾ src/config")
|
||||
expect(focused.some((line) => line.includes("*"))).toBe(false)
|
||||
expect(unfocused.some((line) => line.includes("*"))).toBe(false)
|
||||
})
|
||||
@@ -108,7 +108,7 @@ describe("DiffViewerFileTree", () => {
|
||||
<DiffViewerFileTree files={files} loading={false} error={undefined} theme={theme} expandedNodes={collapsed} />
|
||||
)),
|
||||
),
|
||||
).toEqual(["▸ src", " README.md"])
|
||||
).toEqual(["▸ src/config", " README.md"])
|
||||
|
||||
expect(
|
||||
visibleLines(
|
||||
@@ -122,7 +122,7 @@ describe("DiffViewerFileTree", () => {
|
||||
/>
|
||||
)),
|
||||
),
|
||||
).toEqual(["▾ src", " ▾ config", " tui.ts", " README.md"])
|
||||
).toEqual(["▾ src/config", " tui.ts", " README.md"])
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user