1234567891011121314151617181920 |
- import { beVisible, html, notBeVisible, notHaveAttribute, test } from '../../utils'
- test('x-if',
- html`
- <div x-data="{ show: false }">
- <button @click="show = ! show">Toggle</button>
- <template x-if="show">
- <h1>Toggle Me</h1>
- </template>
- </div>
- `,
- ({ get }) => {
- get('h1').should(notBeVisible())
- get('button').click()
- get('h1').should(beVisible())
- get('button').click()
- get('h1').should(notBeVisible())
- }
- )
|