`)
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 prevent tab event when there is only one element', async () => {
wrapper = _mount(`