Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2018-12-03 14:43:43 +0300
committerFilipa Lacerda <filipa@gitlab.com>2018-12-03 14:43:43 +0300
commit699e1180f6808fa73b5efbe7452efeaae97d408e (patch)
treed104a7eeae9dbf1db29962712a084a20d25cf906 /spec/javascripts/pipelines
parent5a7a221f9b6e53e348c912893c8aa0c76075fbcd (diff)
Fixes race condition in delayed job spec
Diffstat (limited to 'spec/javascripts/pipelines')
-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})`);
});
});
});