summaryrefslogtreecommitdiff
path: root/spec/javascripts/commit
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2017-07-14 15:52:54 +0000
committerPhil Hughes <me@iamphill.com>2017-07-14 15:52:54 +0000
commit706d99aed8985d0a278107295f5f1d26f0b42383 (patch)
tree251eddb4221ee6e7ac0bd960b109981d5c5975f1 /spec/javascripts/commit
parent0618ad12e2b50dd01ec1c5ce440345cb64e26133 (diff)
downloadgitlab-ce-706d99aed8985d0a278107295f5f1d26f0b42383.tar.gz
Update Pipeline's badge count in Merge Request and Commits view to match real-time content
Diffstat (limited to 'spec/javascripts/commit')
-rw-r--r--spec/javascripts/commit/pipelines/pipelines_spec.js35
1 files changed, 35 insertions, 0 deletions
diff --git a/spec/javascripts/commit/pipelines/pipelines_spec.js b/spec/javascripts/commit/pipelines/pipelines_spec.js
index 694f94efcff..a34cadec0ab 100644
--- a/spec/javascripts/commit/pipelines/pipelines_spec.js
+++ b/spec/javascripts/commit/pipelines/pipelines_spec.js
@@ -85,6 +85,41 @@ describe('Pipelines table in Commits and Merge requests', () => {
}, 0);
});
});
+
+ describe('pipeline badge counts', () => {
+ const pipelinesResponse = (request, next) => {
+ next(request.respondWith(JSON.stringify([pipeline]), {
+ status: 200,
+ }));
+ };
+
+ beforeEach(() => {
+ Vue.http.interceptors.push(pipelinesResponse);
+ });
+
+ afterEach(() => {
+ Vue.http.interceptors = _.without(Vue.http.interceptors, pipelinesResponse);
+ this.component.$destroy();
+ });
+
+ it('should receive update-pipelines-count event', (done) => {
+ const element = document.createElement('div');
+ document.body.appendChild(element);
+
+ element.addEventListener('update-pipelines-count', (event) => {
+ expect(event.detail.pipelines).toEqual([pipeline]);
+ done();
+ });
+
+ this.component = new PipelinesTable({
+ propsData: {
+ endpoint: 'endpoint',
+ helpPagePath: 'foo',
+ },
+ }).$mount();
+ element.appendChild(this.component.$el);
+ });
+ });
});
describe('unsuccessfull request', () => {