Skip to content

Commit df5f40f

Browse files
authored
chore(VMaskInput): test mask input clear action agains regression (#22176)
1 parent 698a4c3 commit df5f40f

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

packages/vuetify/src/labs/VMaskInput/__tests__/VMaskInput.spec.browser.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,21 @@ describe('VMaskInput', () => {
3232
expect(inputValue.value).toBe('(456) 7')
3333
})
3434

35+
it('should clear the input when clear icon is clicked', async () => {
36+
const inputValue = ref('(456) 7')
37+
38+
render(() => (
39+
<VMaskInput
40+
v-model={ inputValue.value }
41+
mask="(###) #"
42+
clearable
43+
/>
44+
))
45+
46+
await userEvent.click(screen.getByLabelText('Clear'))
47+
expect(inputValue.value).toBe('')
48+
})
49+
3550
describe('Caret Position and Formatting', () => {
3651
const renderComponent = ({
3752
defaultModel = '(AS)-123-XYZ-45-67',

0 commit comments

Comments
 (0)