1234567891011121314151617 |
- import { haveText, html, test } from '../../utils'
- test('can perist data',
- [html`
- <div x-data="{ count: $persist(1) }">
- <button @click="count++">Inc</button>
- <span x-text="count"></span>
- </div>
- `],
- ({ get }, reload) => {
- get('span').should(haveText('1'))
- get('button').click()
- get('span').should(haveText('2'))
- reload()
- get('span').should(haveText('2'))
- },
- )
|