From 500fd1d6cf4a4ea5afe4e3fd0c8ee41b4c697096 Mon Sep 17 00:00:00 2001 From: Alexander Shabunevich Date: Thu, 11 Apr 2024 21:49:14 +0300 Subject: [PATCH] test: warning about input type --- test/mask-input.test.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) 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 {