fix test to use now tolerance
This commit is contained in:
parent
64737f32d2
commit
602dded2fd
|
@ -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', () => {
|
||||
|
|
Loading…
Reference in New Issue