Fixes race condition in delayed job spec
This commit is contained in:
parent
5a7a221f9b
commit
699e1180f6
1 changed files with 6 additions and 18 deletions
|
@ -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()
|
|
||||||
.then(() => {
|
|
||||||
expect(
|
expect(
|
||||||
component.$el
|
component.$el
|
||||||
.querySelector('.js-pipeline-graph-job-link')
|
.querySelector('.js-pipeline-graph-job-link')
|
||||||
.getAttribute('data-original-title'),
|
.getAttribute('data-original-title'),
|
||||||
).toEqual('delayed job - delayed manual action (00:15:00)');
|
).toEqual(`delayed job - delayed manual action (${component.remainingTime})`);
|
||||||
})
|
|
||||||
.then(done)
|
|
||||||
.catch(done.fail);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue