Skip to content

Commit

Permalink
Fix alpinejs test
Browse files Browse the repository at this point in the history
  • Loading branch information
le0pard committed Nov 19, 2024
1 parent 52797e4 commit 52eb516
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/alpine.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,20 +122,20 @@ describe('bindings', () => {
input = await prepareInput(
`<div x-data="{ iscompleted: false }">
<input x-maska:iscompleted.completed data-maska="#-#">
<span x-show="iscompleted"></span>
<span x-text="\`Completed: \${iscompleted ? 'yes' : 'no'}\`"></span>
</div>`
)
const span = <HTMLSpanElement>document.querySelector('span')

await user.type(input, '1')

expect(input).toHaveValue('1')
expect(span).not.toBeVisible()
expect(span).toHaveTextContent('Completed: no')

await user.type(input, '2')

expect(input).toHaveValue('1-2')
expect(span).toBeVisible()
expect(span).toHaveTextContent('Completed: yes')
})

test('bind masked with onMask', async () => {
Expand Down

0 comments on commit 52eb516

Please sign in to comment.