2
0
mirror of https://github.com/tenrok/maska.git synced 2026-06-17 19:21:21 +03:00

test: warning about input type

This commit is contained in:
Alexander Shabunevich
2024-04-11 21:49:14 +03:00
parent 9943a17fd1
commit 500fd1d6cf
+11
View File
@@ -120,6 +120,17 @@ describe('test init', () => {
await user.type(input, '1a') await user.type(input, '1a')
expect(input).toHaveValue('1a') expect(input).toHaveValue('1a')
}) })
test('wrong input type', async () => {
document.body.innerHTML = `<input id="input" type="email" data-maska-eager>`
const input = <HTMLInputElement>document.getElementById('input')
const logSpy = vi.spyOn(console, 'warn')
new MaskInput(input)
expect(logSpy).toHaveBeenCalledOnce();
expect(logSpy).toHaveBeenCalledWith('Maska: input of `%s` type is not supported', 'email');
})
}) })
interface HooksTestContext { interface HooksTestContext {