diff --git a/src/components/common/__tests__/VnInputDate.spec.js b/src/components/common/__tests__/VnInputDate.spec.js index 3cb037c63..4ffb2a44e 100644 --- a/src/components/common/__tests__/VnInputDate.spec.js +++ b/src/components/common/__tests__/VnInputDate.spec.js @@ -59,6 +59,15 @@ describe('VnInputDate', () => { await vm.formatDate(); expect(vm.model).toBe('2001-03-11T23:00:00.000Z'); }); + + it('should add errColor when invalid date is entered', async () => { + const input = wrapper.find('input'); + await input.setValue('31.13-23'); + await vm.$nextTick(); + await vm.formatDate(); + const inputStyle = input.attributes('input-style'); + expect(inputStyle).not.toBe(''); + }); }); describe('styleAttrs', () => {