`)
expect(document.activeElement).toBe(document.body)
await wrapper.find('.button-1').trigger('keydown', {
code: 'Tab',
shiftKey: true,
})
expect(document.activeElement).toBe(wrapper.find('.button-3').element)
await wrapper.find('.button-3').trigger('keydown', {
code: 'Tab',
})
expect(document.activeElement).toBe(wrapper.find('.button-1').element)
// the current active element is .button-1
await wrapper.find('.button-1').trigger('keydown', {
code: 'Tab',
})
expect(document.activeElement).toBe(wrapper.find('.button-2').element)
// now the active element became .button-2, this time we navigate back
await wrapper.find('.button-2').trigger('keydown', {
code: 'Tab',
shiftKey: true,
})
expect(document.activeElement).toBe(wrapper.find('.button-1').element)
})
test('should focus on the only focusable element', async () => {
wrapper = _mount(`