From b5639b9c20892c70f04375e8d1c940cbc33a492e Mon Sep 17 00:00:00 2001 From: Brian Clifton Date: Mon, 4 Dec 2017 09:20:39 -0700 Subject: [PATCH] lastMonday not working as expected :( `npm run unittest -- --grep="update date handling"` Auditors: @aekeus --- test/unit/app/browser/datesTest.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/unit/app/browser/datesTest.js b/test/unit/app/browser/datesTest.js index bcb08cc0ab9..4f08a01b979 100644 --- a/test/unit/app/browser/datesTest.js +++ b/test/unit/app/browser/datesTest.js @@ -8,6 +8,7 @@ require('../../braveUnit') describe('update date handling', function () { const exampleDate = 1510708981887 // Tuesday November 14th 2017, 6:23:01 PM + const exampleDate2 = 1512404291746 // Monday December 04th 2017, 9:18:11 AM let fakeClock before(function () { fakeClock = sinon.useFakeTimers(exampleDate) @@ -37,8 +38,11 @@ describe('update date handling', function () { describe('lastMonday', function () { it('returns YYYY-MM-DD of closest Monday in the past to current date', function () { - var d = new Date(exampleDate) + let d = new Date(exampleDate) assert.equal(dates.lastMonday(d), '2017-11-13', 'previous Monday') + + d = new Date(exampleDate2) + assert.equal(dates.lastMonday(d), '2017-11-28', 'previous Monday') }) }) })