From 07742c02545c6ed725779e91fef73a96974be0b1 Mon Sep 17 00:00:00 2001
From: winh <winnie@gitlab.com>
Date: Tue, 13 Jun 2017 13:48:13 +0200
Subject: [PATCH] Add failing test for #32987

---
 .../components/mr_widget_pipeline_spec.js     | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/spec/javascripts/vue_mr_widget/components/mr_widget_pipeline_spec.js b/spec/javascripts/vue_mr_widget/components/mr_widget_pipeline_spec.js
index 647b59520f8..0ffa4ac46e3 100644
--- a/spec/javascripts/vue_mr_widget/components/mr_widget_pipeline_spec.js
+++ b/spec/javascripts/vue_mr_widget/components/mr_widget_pipeline_spec.js
@@ -76,6 +76,25 @@ describe('MRWidgetPipeline', () => {
       el = vm.$el;
     });
 
+    afterEach(() => {
+      vm.$destroy();
+    });
+
+    describe('without a pipeline', () => {
+      beforeEach(() => {
+        vm.mr = { pipeline: null };
+      });
+
+      it('should render message with spinner', (done) => {
+        Vue.nextTick(() => {
+          expect(el.querySelector('.pipeline-id')).toBe(null);
+          expect(el.innerText.trim()).toBe('Waiting for pipeline...');
+          expect(el.querySelectorAll('i.fa.fa-spinner.fa-spin').length).toBe(1);
+          done();
+        });
+      });
+    });
+
     it('should render template elements correctly', () => {
       expect(el.classList.contains('mr-widget-heading')).toBeTruthy();
       expect(el.querySelectorAll('.ci-status-icon.ci-status-icon-success').length).toEqual(1);
-- 
2.30.9