summaryrefslogtreecommitdiff
path: root/spec/javascripts/job_spec.js
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2018-07-16 23:07:36 +0800
committerLin Jen-Shin <godfat@godfat.org>2018-07-16 23:07:36 +0800
commitafe44451f46e2c470f429b0b6f73e04d49e66f7c (patch)
tree2388a3f85355ca180d2256f9c9299b5bf2dda059 /spec/javascripts/job_spec.js
parent5c4934ee9486fb5ce7f14581680369010009835b (diff)
parenta73f480715f086e86d781e22d8a76b71c3b0680a (diff)
downloadgitlab-ce-afe44451f46e2c470f429b0b6f73e04d49e66f7c.tar.gz
Merge remote-tracking branch 'upstream/master' into ce-6038-rebase-preserve-merge * upstream/master: (173 commits) Fix invalid link to GitLab.com architecture.md i18n: externalize strings from 'app/views/import' Remove Repository#lookup and unreachable rugged code refactor code based on feedback Trigger rails5 tests either by variable or ref name Fix link in help doc which was linking to old mono-repo, now in its own repo Allow Danger step to fail update webpack to v4.16 Backport logger changes from EE Add the CI Job trigger as the build trigger Remove flaky and redundant expectations use fileuploader dynamic path method in uploads manager and add spec fix typo in uploads manager add small comment to download method in uploads manager refactor uploads manager Update 10.6-to-10.7.md Lazy-load performance bar UI Update .gitlab-ci.yml fixed test to correctly text relative URLs doesnt add query param if source & target projects match Add changelog entry ...
Diffstat (limited to 'spec/javascripts/job_spec.js')
-rw-r--r--spec/javascripts/job_spec.js27
1 files changed, 12 insertions, 15 deletions
diff --git a/spec/javascripts/job_spec.js b/spec/javascripts/job_spec.js
index 79e375aa02e..2fcb5566ebc 100644
--- a/spec/javascripts/job_spec.js
+++ b/spec/javascripts/job_spec.js
@@ -5,6 +5,7 @@ import { numberToHumanSize } from '~/lib/utils/number_utils';
import '~/lib/utils/datetime_utility';
import Job from '~/job';
import '~/breakpoints';
+import waitForPromises from 'spec/helpers/wait_for_promises';
describe('Job', () => {
const JOB_URL = `${gl.TEST_HOST}/frontend-fixtures/builds-project/-/jobs/1`;
@@ -12,10 +13,6 @@ describe('Job', () => {
let response;
let job;
- function waitForPromise() {
- return new Promise(resolve => requestAnimationFrame(resolve));
- }
-
preloadFixtures('builds/build-with-artifacts.html.raw');
beforeEach(() => {
@@ -49,7 +46,7 @@ describe('Job', () => {
beforeEach(function (done) {
job = new Job();
- waitForPromise()
+ waitForPromises()
.then(done)
.catch(done.fail);
});
@@ -93,7 +90,7 @@ describe('Job', () => {
job = new Job();
- waitForPromise()
+ waitForPromises()
.then(() => {
expect($('#build-trace .js-build-output').text()).toMatch(/Update/);
expect(job.state).toBe('newstate');
@@ -107,7 +104,7 @@ describe('Job', () => {
};
})
.then(() => jasmine.clock().tick(4001))
- .then(waitForPromise)
+ .then(waitForPromises)
.then(() => {
expect($('#build-trace .js-build-output').text()).toMatch(/UpdateMore/);
expect(job.state).toBe('finalstate');
@@ -126,7 +123,7 @@ describe('Job', () => {
job = new Job();
- waitForPromise()
+ waitForPromises()
.then(() => {
expect($('#build-trace .js-build-output').text()).toMatch(/Update/);
@@ -137,7 +134,7 @@ describe('Job', () => {
};
})
.then(() => jasmine.clock().tick(4001))
- .then(waitForPromise)
+ .then(waitForPromises)
.then(() => {
expect($('#build-trace .js-build-output').text()).not.toMatch(/Update/);
expect($('#build-trace .js-build-output').text()).toMatch(/Different/);
@@ -160,7 +157,7 @@ describe('Job', () => {
job = new Job();
- waitForPromise()
+ waitForPromises()
.then(() => {
expect(document.querySelector('.js-truncated-info').classList).not.toContain('hidden');
})
@@ -181,7 +178,7 @@ describe('Job', () => {
job = new Job();
- waitForPromise()
+ waitForPromises()
.then(() => {
expect(
document.querySelector('.js-truncated-info-size').textContent.trim(),
@@ -203,7 +200,7 @@ describe('Job', () => {
job = new Job();
- waitForPromise()
+ waitForPromises()
.then(() => {
expect(
document.querySelector('.js-truncated-info-size').textContent.trim(),
@@ -219,7 +216,7 @@ describe('Job', () => {
};
})
.then(() => jasmine.clock().tick(4001))
- .then(waitForPromise)
+ .then(waitForPromises)
.then(() => {
expect(
document.querySelector('.js-truncated-info-size').textContent.trim(),
@@ -258,7 +255,7 @@ describe('Job', () => {
job = new Job();
- waitForPromise()
+ waitForPromises()
.then(() => {
expect(document.querySelector('.js-truncated-info').classList).toContain('hidden');
})
@@ -280,7 +277,7 @@ describe('Job', () => {
job = new Job();
- waitForPromise()
+ waitForPromises()
.then(done)
.catch(done.fail);
});