Commit a6713065 authored by Mike Greiling's avatar Mike Greiling Committed by Phil Hughes

Resolve "Transient karma failure on master for `Date time utils timeFor...

Resolve "Transient karma failure on master for `Date time utils timeFor returns remaining time when in the future`"
parent 5214e507
...@@ -16,6 +16,10 @@ import { timeIntervalInWords } from '~/lib/utils/datetime_utility'; ...@@ -16,6 +16,10 @@ import { timeIntervalInWords } from '~/lib/utils/datetime_utility';
const date = new Date(); const date = new Date();
date.setFullYear(date.getFullYear() + 1); date.setFullYear(date.getFullYear() + 1);
// Add a day to prevent a transient error. If date is even 1 second
// short of a full year, timeFor will return '11 months remaining'
date.setDate(date.getDate() + 1);
expect( expect(
gl.utils.timeFor(date), gl.utils.timeFor(date),
).toBe('1 year remaining'); ).toBe('1 year remaining');
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment