From 0edad3897ebcb07f1f1695606c5bd1c363982049 Mon Sep 17 00:00:00 2001 From: Tom Foo <20580619+MincedCutlet@users.noreply.github.com> Date: Tue, 28 Jan 2020 00:17:09 -0500 Subject: [PATCH] Fixes tests --- test/utils/TimeSlots.test.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/utils/TimeSlots.test.js b/test/utils/TimeSlots.test.js index 9ec0d2971..a27f2aa14 100644 --- a/test/utils/TimeSlots.test.js +++ b/test/utils/TimeSlots.test.js @@ -2,8 +2,8 @@ import { getSlotMetrics } from '../../src/utils/TimeSlots' import * as dates from '../../src/utils/dates' describe('getSlotMetrics', () => { - const min = dates.startOf(new Date(), 'day') - const max = dates.endOf(new Date(), 'day') + const min = dates.startOf(new Date(2018, 0, 29, 0, 0, 0), 'day') + const max = dates.endOf(new Date(2018, 0, 29, 59, 59, 59), 'day') const slotMetrics = getSlotMetrics({ min, max, step: 60, timeslots: 1 }) test('getSlotMetrics.closestSlotToPosition: always returns timeslot if valid percentage is given', () => { expect(slotMetrics.closestSlotToPosition(0)).toBeDefined() @@ -24,9 +24,9 @@ describe('getSlotMetrics', () => { }) describe('getRange', () => { - const min = dates.startOf(new Date(), 'day') - const max = dates.endOf(new Date(), 'day') - const slotMetrics = getSlotMetrics({ min, max, step: 60, timeslots: 1 }) + const min = dates.startOf(new Date(2018, 0, 29, 0, 0, 0), 'day') + const max = dates.endOf(new Date(2018, 0, 29, 24, 0, 0), 'day') + const slotMetrics = getSlotMetrics({ min, max, step: 15, timeslots: 1 }) test('getRange: 15 minute start of day appointment stays within calendar', () => { let range = slotMetrics.getRange(