From 730245e204aae26826c82fa6e2739c4eea2a06e7 Mon Sep 17 00:00:00 2001 From: Bouncey Date: Mon, 3 Dec 2018 10:38:10 +0000 Subject: [PATCH] fix: Fix up my broken test reformatting --- api-server/server/utils/date-utils.test.js | 81 ++++++++++++---------- 1 file changed, 43 insertions(+), 38 deletions(-) diff --git a/api-server/server/utils/date-utils.test.js b/api-server/server/utils/date-utils.test.js index 8c7982a3dd..dc3c3f703f 100644 --- a/api-server/server/utils/date-utils.test.js +++ b/api-server/server/utils/date-utils.test.js @@ -25,59 +25,64 @@ describe('date utils', () => { ).toEqual(1); }); - it('should return 2 days when there is a 24 hours difference', () => {}); - expect( - dayCount([ - moment.utc('8/4/2015 2:00', 'M/D/YYYY H:mm').valueOf(), - moment.utc('8/3/2015 2:00', 'M/D/YYYY H:mm').valueOf() - ]) - ).toEqual(2); + it('should return 2 days when there is a 24 hours difference', () => { + expect( + dayCount([ + moment.utc('8/4/2015 2:00', 'M/D/YYYY H:mm').valueOf(), + moment.utc('8/3/2015 2:00', 'M/D/YYYY H:mm').valueOf() + ]) + ).toEqual(2); + }); it( 'should return 2 days when the diff is less than 24h but ' + 'different in UTC', - () => {} + () => { + expect( + dayCount([ + moment.utc('8/4/2015 1:00', 'M/D/YYYY H:mm').valueOf(), + moment.utc('8/3/2015 23:00', 'M/D/YYYY H:mm').valueOf() + ]) + ).toEqual(2); + } ); - expect( - dayCount([ - moment.utc('8/4/2015 1:00', 'M/D/YYYY H:mm').valueOf(), - moment.utc('8/3/2015 23:00', 'M/D/YYYY H:mm').valueOf() - ]) - ).toEqual(2); it( 'should return 1 day when the diff is less than 24h ' + 'and days are different in UTC, but given PST', - () => {} + () => { + expect( + dayCount( + [ + moment.utc('8/4/2015 1:00', 'M/D/YYYY H:mm').valueOf(), + moment.utc('8/3/2015 23:00', 'M/D/YYYY H:mm').valueOf() + ], + PST + ) + ).toEqual(1); + } ); - expect( - dayCount( - [ - moment.utc('8/4/2015 1:00', 'M/D/YYYY H:mm').valueOf(), - moment.utc('8/3/2015 23:00', 'M/D/YYYY H:mm').valueOf() - ], - PST - ) - ).toEqual(1); - it('should return correct count when there is very big period', () => {}); - expect( - dayCount([ - moment.utc('10/27/2015 1:00', 'M/D/YYYY H:mm').valueOf(), - moment.utc('5/12/1982 1:00', 'M/D/YYYY H:mm').valueOf() - ]) - ).toEqual(12222); + it('should return correct count when there is very big period', () => { + expect( + dayCount([ + moment.utc('10/27/2015 1:00', 'M/D/YYYY H:mm').valueOf(), + moment.utc('5/12/1982 1:00', 'M/D/YYYY H:mm').valueOf() + ]) + ).toEqual(12222); + }); it( 'should return 2 days when there is a 24 hours difference ' + 'between dates given `undefined` timezone', - () => {} + () => { + expect( + dayCount([ + moment.utc('8/4/2015 2:00', 'M/D/YYYY H:mm').valueOf(), + moment.utc('8/3/2015 2:00', 'M/D/YYYY H:mm').valueOf() + ]) + ).toEqual(2); + } ); - expect( - dayCount([ - moment.utc('8/4/2015 2:00', 'M/D/YYYY H:mm').valueOf(), - moment.utc('8/3/2015 2:00', 'M/D/YYYY H:mm').valueOf() - ]) - ).toEqual(2); }); });