From 957b12b196150051e9ede1c94286a20f9a036c5a Mon Sep 17 00:00:00 2001 From: Simon Egersand Date: Sat, 27 Jan 2018 00:25:02 +0100 Subject: [PATCH] Don't rely on dynamic data in test --- test/tests.spec.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/tests.spec.js b/test/tests.spec.js index bd2e83413..252e84faf 100644 --- a/test/tests.spec.js +++ b/test/tests.spec.js @@ -64,8 +64,8 @@ describe('Datetime', () => { }); it('persistent valid months going monthView->yearView->monthView', () => { - const dateBefore = new Date().getFullYear() + '-06-01', - component = utils.createDatetime({ viewMode: 'months', isValidDate: (current) => + const dateBefore = '2018-06-01'; + const component = utils.createDatetime({ viewMode: 'months', isValidDate: (current) => current.isBefore(moment(dateBefore, 'YYYY-MM-DD')) }); @@ -78,9 +78,9 @@ describe('Datetime', () => { expect(utils.isYearView(component)).toBeTruthy(); expect(utils.getNthYear(component, 0).hasClass('rdtDisabled')).toEqual(false); - expect(utils.getNthYear(component, 9).hasClass('rdtDisabled')).toEqual(true); + expect(utils.getNthYear(component, 10).hasClass('rdtDisabled')).toEqual(true); - utils.clickNthYear(component, 8); + utils.clickNthYear(component, 9); expect(utils.getNthMonth(component, 4).hasClass('rdtDisabled')).toEqual(false); expect(utils.getNthMonth(component, 5).hasClass('rdtDisabled')).toEqual(true); });