Skip to content

Commit

Permalink
Allow larger difference in index threshold jest test (#72506)
Browse files Browse the repository at this point in the history
* Allow large difference in index threshold jest test

* Fix variable name
  • Loading branch information
mikecote authored Jul 22, 2020
1 parent 0a3170f commit 9374a42
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,11 @@ describe('getRangeInfo', () => {
it('should handle no dateStart, dateEnd or interval specified', async () => {
const nowM0 = Date.now();
const nowM5 = nowM0 - 1000 * 60 * 5;
const digitPrecision = 1;

const info = getDateRangeInfo(BaseRangeQuery);
expect(sloppyMilliDiff(nowM5, Date.parse(info.dateStart))).toBeCloseTo(0);
expect(sloppyMilliDiff(nowM0, Date.parse(info.dateEnd))).toBeCloseTo(0);
expect(sloppyMilliDiff(nowM5, Date.parse(info.dateStart))).toBeCloseTo(0, digitPrecision);
expect(sloppyMilliDiff(nowM0, Date.parse(info.dateEnd))).toBeCloseTo(0, digitPrecision);
expect(info.dateRanges.length).toEqual(1);
expect(info.dateRanges[0].from).toEqual(info.dateStart);
expect(info.dateRanges[0].to).toEqual(info.dateEnd);
Expand Down

0 comments on commit 9374a42

Please sign in to comment.