fix test to use now tolerance

This commit is contained in:
shpuld 2019-06-17 21:20:23 +03:00
parent 64737f32d2
commit 602dded2fd
1 changed files with 4 additions and 4 deletions

View File

@ -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', () => {