import { haveAttribute, haveComputedStyle, html, test } from '../../utils'
test('can collapse and expand element',
[html`
contents
`],
({ get }, reload) => {
get('h1').should(haveComputedStyle('height', '0px'))
get('h1').should(haveAttribute('style', 'height: 0px; overflow: hidden;'))
get('button').click()
get('h1').should(haveAttribute('style', 'height: auto;'))
get('button').click()
get('h1').should(haveComputedStyle('height', '0px'))
},
)
test('@click.away with x-collapse (prevent race condition)',
html`
h1
`,
({ get }) => {
get('h1').should(haveComputedStyle('height', '0px'))
get('button').click()
get('h1').should(haveAttribute('style', 'height: auto;'))
}
)
test('@click.away with x-collapse and borders (prevent race condition)',
html`
h1
`,
({ get }) => {
get('h1').should(haveComputedStyle('height', '0px'))
get('button').click()
get('h1').should(haveAttribute('style', 'height: auto;'))
}
)