This commit is contained in:
@@ -74,7 +74,7 @@ describe('Editor view modes', () => {
|
||||
expect(find(c, '.seg button.on', 'Original')).toBeTruthy()
|
||||
})
|
||||
|
||||
it('hovering a band in Actual reveals the original, leaving the editor hides it', async () => {
|
||||
it('clicking a band in Actual reveals the original, clicking it again hides it', async () => {
|
||||
const c = await openChanged()
|
||||
const scroll = await waitFor(() => {
|
||||
const el = c.querySelector<HTMLElement>('.ce-scroll')
|
||||
@@ -83,7 +83,7 @@ describe('Editor view modes', () => {
|
||||
})
|
||||
// Line 30 is the first rewritten line. Unwrapped, its band is arithmetic:
|
||||
// a 10px top pad plus 20px per line, and the hit test reads clientY.
|
||||
fireEvent.mouseMove(scroll, { clientY: 10 + 29 * 20 + 5 })
|
||||
fireEvent.click(scroll, { clientY: 10 + 29 * 20 + 5 })
|
||||
const peek = await waitFor(() => {
|
||||
const p = c.querySelector<HTMLElement>('.peek')
|
||||
if (!p) throw new Error('peek not ready')
|
||||
@@ -93,7 +93,8 @@ describe('Editor view modes', () => {
|
||||
expect(removed).toHaveLength(1)
|
||||
expect(removed[0].textContent).toContain("'plan' => $user->plan,")
|
||||
|
||||
fireEvent.mouseLeave(scroll)
|
||||
// A second click on the same band drops it.
|
||||
fireEvent.click(scroll, { clientY: 10 + 29 * 20 + 5 })
|
||||
await waitFor(() => expect(c.querySelector('.peek')).toBeNull())
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user