From 013968f609c32e2269df69b4dd1feb2e8e1e035a Mon Sep 17 00:00:00 2001 From: Ilya Kitayev <31045326+illjah42@users.noreply.github.com> Date: Thu, 22 Jun 2023 12:21:41 +0300 Subject: [PATCH] fix(): check if null passed to objectSupport parser (#2175) --- test/plugin/objectSupport.test.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/plugin/objectSupport.test.js b/test/plugin/objectSupport.test.js index 68dd4e4a..abf046d3 100755 --- a/test/plugin/objectSupport.test.js +++ b/test/plugin/objectSupport.test.js @@ -390,3 +390,11 @@ it('add decimal values of days and months', () => { expect(dayjs([2016, 7, 1]).add(1.6, 'years').format('YYYY-MM-DD')).toBe('2017-07-01') expect(dayjs([2016, 1, 1]).add(1.1, 'quarters').format('YYYY-MM-DD')).toBe('2016-04-01') }) + +it('returns valid date on undefined', () => { + expect(dayjs().isValid()).toBe(true) +}) + +it('returns invalid date on null', () => { + expect(dayjs(null).isValid()).toBe(false) +})