Skip to content

Commit bec69df

Browse files
Bill LeoutsakosBill Leoutsakos
authored andcommitted
Test fork disclosure keyboard focus
1 parent 454d9d7 commit bec69df

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎apps/sim/ee/workspace-forking/components/fork-disclosure-trigger.test.tsx‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,13 @@ describe('ForkDisclosureTrigger', () => {
6161
expect(resources?.getAttribute('aria-expanded')).toBe('true')
6262
expect(mapping?.getAttribute('aria-expanded')).toBe('false')
6363
})
64+
65+
it('keeps the disclosure trigger keyboard focusable with its visible focus treatment', () => {
66+
const trigger = container.querySelector<HTMLButtonElement>('button')
67+
act(() => trigger?.focus())
68+
69+
expect(document.activeElement).toBe(trigger)
70+
expect(trigger?.classList.contains('focus-visible:outline-2')).toBe(true)
71+
expect(trigger?.classList.contains('focus-visible:outline-[var(--selection)]')).toBe(true)
72+
})
6473
})

0 commit comments

Comments
 (0)