From 0e66e3362f6de25297faa916fb2c917b89efe27a Mon Sep 17 00:00:00 2001 From: jtubau Date: Wed, 16 Apr 2025 15:20:45 +0200 Subject: [PATCH] test: refs #8413 add validation for error color on invalid date input in VnInputDate component --- src/components/common/__tests__/VnInputDate.spec.js | 9 +++++++++ 1 file changed, 9 insertions(+) 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', () => {