Improve the git diff preview from the file viewer
CI / check (push) Waiting to run

This commit is contained in:
2026-09-21 06:47:46 +02:00
parent a2d1c5df83
commit dbb7e40c6c
10 changed files with 98 additions and 221 deletions
+4 -7
View File
@@ -52,7 +52,7 @@ describe('a change that only removes a line', () => {
expect(c.querySelector('.ce-gutter .chg')).toBeNull()
})
it('hands the removed line to the picked panel', async () => {
it('opens the full-screen Diff from the ruled line', async () => {
const c = await openRow()
const scroll = await waitFor(() => {
const el = c.querySelector<HTMLElement>('.ce-scroll')
@@ -61,11 +61,8 @@ describe('a change that only removes a line', () => {
})
// 'tail' took the place of the removed line, and sits on line 2.
fireEvent.click(scroll, { clientY: 10 + 20 + 5 })
const peek = await waitFor(() => {
const p = c.querySelector<HTMLElement>('.peek')
if (!p) throw new Error('peek not ready')
return p
})
expect(Array.from(peek.querySelectorAll('.ln-row.del')).map((el) => el.textContent?.replace(/^\d+/, ''))).toEqual(['gone'])
await waitFor(() => expect(c.querySelector('.split-overlay')).toBeTruthy())
const left = Array.from(c.querySelectorAll('.split-pane.left .ln-row.del'))
expect(left.map((el) => el.textContent?.replace(/^\d+/, ''))).toEqual(['gone'])
})
})