Skip to content

Commit

Permalink
Add a test
Browse files Browse the repository at this point in the history
  • Loading branch information
joshhanley committed Dec 20, 2024
1 parent d02aeaf commit abf988c
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/cypress/integration/plugins/mask.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,21 @@ test('x-mask with x-model with initial value',
},
)

test('x-mask with x-model if initial value is null it should remain null',
[html`
<div x-data="{ value: null }">
<input x-mask="(999) 999-9999" x-model="value" id="1">
<input id="2" x-model="value">
<span id="3" x-text="value === null ? 'NULL' : value"></span>
</div>
`],
({ get }) => {
get('#1').should(haveValue(''))
get('#2').should(haveValue(''))
get('#3').contains('NULL')
},
)

test('x-mask with a falsy input',
[html`<input x-data x-mask="">`],
({ get }) => {
Expand Down

0 comments on commit abf988c

Please sign in to comment.