Commit 699e1180 authored by Filipa Lacerda's avatar Filipa Lacerda

Fixes race condition in delayed job spec

parent 5a7a221f
...@@ -140,28 +140,16 @@ describe('pipeline graph job item', () => { ...@@ -140,28 +140,16 @@ describe('pipeline graph job item', () => {
}); });
describe('for delayed job', () => { describe('for delayed job', () => {
beforeEach(() => { it('displays remaining time in tooltip', () => {
const fifteenMinutesInMilliseconds = 900000;
spyOn(Date, 'now').and.callFake(
() => new Date(delayedJobFixture.scheduled_at).getTime() - fifteenMinutesInMilliseconds,
);
});
it('displays remaining time in tooltip', done => {
component = mountComponent(JobComponent, { component = mountComponent(JobComponent, {
job: delayedJobFixture, job: delayedJobFixture,
}); });
Vue.nextTick() expect(
.then(() => { component.$el
expect( .querySelector('.js-pipeline-graph-job-link')
component.$el .getAttribute('data-original-title'),
.querySelector('.js-pipeline-graph-job-link') ).toEqual(`delayed job - delayed manual action (${component.remainingTime})`);
.getAttribute('data-original-title'),
).toEqual('delayed job - delayed manual action (00:15:00)');
})
.then(done)
.catch(done.fail);
}); });
}); });
}); });
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