diff --git a/test/mask-input.test.ts b/test/mask-input.test.ts index 0159e0d..04815ca 100644 --- a/test/mask-input.test.ts +++ b/test/mask-input.test.ts @@ -120,6 +120,17 @@ describe('test init', () => { await user.type(input, '1a') expect(input).toHaveValue('1a') }) + + test('wrong input type', async () => { + document.body.innerHTML = `` + const input = 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 {