Skip to content

Commit abf988c

Browse files
committed
Add a test
1 parent d02aeaf commit abf988c

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/cypress/integration/plugins/mask.spec.js

+15
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,21 @@ test('x-mask with x-model with initial value',
8989
},
9090
)
9191

92+
test('x-mask with x-model if initial value is null it should remain null',
93+
[html`
94+
<div x-data="{ value: null }">
95+
<input x-mask="(999) 999-9999" x-model="value" id="1">
96+
<input id="2" x-model="value">
97+
<span id="3" x-text="value === null ? 'NULL' : value"></span>
98+
</div>
99+
`],
100+
({ get }) => {
101+
get('#1').should(haveValue(''))
102+
get('#2').should(haveValue(''))
103+
get('#3').contains('NULL')
104+
},
105+
)
106+
92107
test('x-mask with a falsy input',
93108
[html`<input x-data x-mask="">`],
94109
({ get }) => {

0 commit comments

Comments
 (0)