summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2018-12-03 11:43:43 +0000
committerFilipa Lacerda <filipa@gitlab.com>2018-12-03 11:43:43 +0000
commit699e1180f6808fa73b5efbe7452efeaae97d408e (patch)
treed104a7eeae9dbf1db29962712a084a20d25cf906 /spec
parent5a7a221f9b6e53e348c912893c8aa0c76075fbcd (diff)
downloadgitlab-ce-699e1180f6808fa73b5efbe7452efeaae97d408e.tar.gz
Fixes race condition in delayed job spec
Diffstat (limited to 'spec')
-rw-r--r--spec/javascripts/pipelines/graph/job_item_spec.js24
1 files changed, 6 insertions, 18 deletions
diff --git a/spec/javascripts/pipelines/graph/job_item_spec.js b/spec/javascripts/pipelines/graph/job_item_spec.js
index 12b45eb145f..1cdb0aff524 100644
--- a/spec/javascripts/pipelines/graph/job_item_spec.js
+++ b/spec/javascripts/pipelines/graph/job_item_spec.js
@@ -140,28 +140,16 @@ describe('pipeline graph job item', () => {
});
describe('for delayed job', () => {
- beforeEach(() => {
- const fifteenMinutesInMilliseconds = 900000;
- spyOn(Date, 'now').and.callFake(
- () => new Date(delayedJobFixture.scheduled_at).getTime() - fifteenMinutesInMilliseconds,
- );
- });
-
- it('displays remaining time in tooltip', done => {
+ it('displays remaining time in tooltip', () => {
component = mountComponent(JobComponent, {
job: delayedJobFixture,
});
- Vue.nextTick()
- .then(() => {
- expect(
- component.$el
- .querySelector('.js-pipeline-graph-job-link')
- .getAttribute('data-original-title'),
- ).toEqual('delayed job - delayed manual action (00:15:00)');
- })
- .then(done)
- .catch(done.fail);
+ expect(
+ component.$el
+ .querySelector('.js-pipeline-graph-job-link')
+ .getAttribute('data-original-title'),
+ ).toEqual(`delayed job - delayed manual action (${component.remainingTime})`);
});
});
});