mirror of
https://github.com/tenrok/maska.git
synced 2026-06-20 20:00:34 +03:00
Fix alpinejs test
This commit is contained in:
+3
-3
@@ -122,7 +122,7 @@ describe('bindings', () => {
|
|||||||
input = await prepareInput(
|
input = await prepareInput(
|
||||||
`<div x-data="{ iscompleted: false }">
|
`<div x-data="{ iscompleted: false }">
|
||||||
<input x-maska:iscompleted.completed data-maska="#-#">
|
<input x-maska:iscompleted.completed data-maska="#-#">
|
||||||
<span x-show="iscompleted"></span>
|
<span x-text="\`Completed: \${iscompleted ? 'yes' : 'no'}\`"></span>
|
||||||
</div>`
|
</div>`
|
||||||
)
|
)
|
||||||
const span = <HTMLSpanElement>document.querySelector('span')
|
const span = <HTMLSpanElement>document.querySelector('span')
|
||||||
@@ -130,12 +130,12 @@ describe('bindings', () => {
|
|||||||
await user.type(input, '1')
|
await user.type(input, '1')
|
||||||
|
|
||||||
expect(input).toHaveValue('1')
|
expect(input).toHaveValue('1')
|
||||||
expect(span).not.toBeVisible()
|
expect(span).toHaveTextContent('Completed: no')
|
||||||
|
|
||||||
await user.type(input, '2')
|
await user.type(input, '2')
|
||||||
|
|
||||||
expect(input).toHaveValue('1-2')
|
expect(input).toHaveValue('1-2')
|
||||||
expect(span).toBeVisible()
|
expect(span).toHaveTextContent('Completed: yes')
|
||||||
})
|
})
|
||||||
|
|
||||||
test('bind masked with onMask', async () => {
|
test('bind masked with onMask', async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user