import { beVisible, haveFocus, html, notBeVisible, test } from '../../../utils' test('can use tabs to toggle panels', [html`
First Panel
Second Panel
`], ({ get }) => { get('[panel-1]').should(beVisible()) get('[panel-2]').should(notBeVisible()) get('[button-2]').click() get('[panel-1]').should(notBeVisible()) get('[panel-2]').should(beVisible()) }, ) test('can use arrow keys to cycle through tabs', [html`
First Panel
Second Panel
`], ({ get }) => { get('[panel-1]').should(beVisible()) get('[panel-2]').should(notBeVisible()) get('[button-2]').click() get('[button-2]').should(haveFocus()) get('[panel-1]').should(notBeVisible()) get('[panel-2]').should(beVisible()) get('[button-2]').type('{rightArrow}') get('[button-1]').should(haveFocus()) get('[panel-1]').should(beVisible()) get('[panel-2]').should(notBeVisible()) get('[button-1]').type('{rightArrow}') get('[button-2]').should(haveFocus()) get('[panel-1]').should(notBeVisible()) get('[panel-2]').should(beVisible()) }, ) test('cant tab through tabs, can only use arrows', [html`
First Panel
Second Panel
`], ({ get }) => { get('[button-1]').click() get('[button-1]').should(haveFocus()) get('[button-1]').tab() get('[button-2]').should(haveFocus()) get('[button-2]').tab() get('[panel-1]').should(haveFocus()) get('[panel-1]').tab() get('[button-4]').should(haveFocus()) }, )