From 602dded2fd85d79043904d1c9ad68464a7068bf7 Mon Sep 17 00:00:00 2001 From: shpuld Date: Mon, 17 Jun 2019 21:20:23 +0300 Subject: [PATCH] fix test to use now tolerance --- test/unit/specs/services/date_utils/date_utils.spec.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/unit/specs/services/date_utils/date_utils.spec.js b/test/unit/specs/services/date_utils/date_utils.spec.js index b507602f..b94de760 100644 --- a/test/unit/specs/services/date_utils/date_utils.spec.js +++ b/test/unit/specs/services/date_utils/date_utils.spec.js @@ -1,12 +1,12 @@ import * as DateUtils from 'src/services/date_utils/date_utils.js' -describe.only('DateUtils', () => { +describe('DateUtils', () => { describe('relativeTime', () => { - it('returns now with low amount of seconds', () => { + it('returns now with low enough amount of seconds', () => { const futureTime = Date.now() + 20 * DateUtils.SECOND const pastTime = Date.now() - 20 * DateUtils.SECOND - expect(DateUtils.relativeTime(futureTime)).to.eql({ num: 0, key: 'time.now' }) - expect(DateUtils.relativeTime(pastTime)).to.eql({ num: 0, key: 'time.now' }) + expect(DateUtils.relativeTime(futureTime, 30)).to.eql({ num: 0, key: 'time.now' }) + expect(DateUtils.relativeTime(pastTime, 30)).to.eql({ num: 0, key: 'time.now' }) }) it('rounds down for past', () => {