import { beVisible, haveAttribute, html, notBeVisible, notHaveAttribute, test } from '../../../utils'
test.skip('button toggles panel',
[html`
`],
({ get }) => {
get('ul').should(notBeVisible())
get('button').click()
get('ul').should(beVisible())
get('button').click()
get('ul').should(notBeVisible())
},
)
test.skip('has accessibility attributes',
[html`
`],
({ get }) => {
get('button').should(haveAttribute('aria-expanded', 'false'))
get('button').should(notHaveAttribute('aria-controls'))
get('button').click()
get('button').should(haveAttribute('aria-expanded', 'true'))
get('button').should(haveAttribute('aria-controls', 'alpine-popover-panel-1'))
},
)
test.skip('escape closes panel',
[html`
`],
({ get }) => {
get('ul').should(notBeVisible())
get('button').click()
get('ul').should(beVisible())
get('body').type('{esc}')
get('ul').should(notBeVisible())
},
)
test.skip('clicking outside closes panel',
[html`
`],
({ get }) => {
get('ul').should(notBeVisible())
get('button').click()
get('ul').should(beVisible())
get('h1').click()
get('ul').should(notBeVisible())
},
)
test.skip('focusing away closes panel',
[html`
`],
({ get }) => {
get('ul').should(notBeVisible())
get('button').click()
get('ul').should(beVisible())
cy.focused().tab()
get('ul').should(notBeVisible())
},
)
test.skip('focusing away doesnt close panel if focusing inside a group',
[html`
`],
({ get }) => {
get('#1 ul').should(notBeVisible())
get('#2 ul').should(notBeVisible())
get('#1 button').click()
get('#1 ul').should(beVisible())
get('#2 ul').should(notBeVisible())
cy.focused().tab()
get('#1 ul').should(beVisible())
get('#2 ul').should(notBeVisible())
cy.focused().tab()
get('#1 ul').should(notBeVisible())
get('#2 ul').should(notBeVisible())
},
)