2
0
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:
Alexey Vasiliev
2024-11-19 22:21:20 +02:00
parent 52797e46a2
commit 52eb516719
+3 -3
View File
@@ -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 () => {