From 967812838c7e7742729a4c7aeb9859f98a509622 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Mon, 23 Mar 2020 18:09:25 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- spec/javascripts/cycle_analytics/banner_spec.js | 45 ----------------- .../cycle_analytics/total_time_component_spec.js | 58 ---------------------- 2 files changed, 103 deletions(-) delete mode 100644 spec/javascripts/cycle_analytics/banner_spec.js delete mode 100644 spec/javascripts/cycle_analytics/total_time_component_spec.js (limited to 'spec/javascripts') diff --git a/spec/javascripts/cycle_analytics/banner_spec.js b/spec/javascripts/cycle_analytics/banner_spec.js deleted file mode 100644 index 06fbaa68ffc..00000000000 --- a/spec/javascripts/cycle_analytics/banner_spec.js +++ /dev/null @@ -1,45 +0,0 @@ -import Vue from 'vue'; -import mountComponent from 'spec/helpers/vue_mount_component_helper'; -import banner from '~/cycle_analytics/components/banner.vue'; - -describe('Cycle analytics banner', () => { - let vm; - - beforeEach(() => { - const Component = Vue.extend(banner); - vm = mountComponent(Component, { - documentationLink: 'path', - }); - }); - - afterEach(() => { - vm.$destroy(); - }); - - it('should render value stream analytics information', () => { - expect(vm.$el.querySelector('h4').textContent.trim()).toEqual( - 'Introducing Value Stream Analytics', - ); - - expect( - vm.$el - .querySelector('p') - .textContent.trim() - .replace(/[\r\n]+/g, ' '), - ).toContain( - 'Value Stream Analytics gives an overview of how much time it takes to go from idea to production in your project.', - ); - - expect(vm.$el.querySelector('a').textContent.trim()).toEqual('Read more'); - - expect(vm.$el.querySelector('a').getAttribute('href')).toEqual('path'); - }); - - it('should emit an event when close button is clicked', () => { - spyOn(vm, '$emit'); - - vm.$el.querySelector('.js-ca-dismiss-button').click(); - - expect(vm.$emit).toHaveBeenCalled(); - }); -}); diff --git a/spec/javascripts/cycle_analytics/total_time_component_spec.js b/spec/javascripts/cycle_analytics/total_time_component_spec.js deleted file mode 100644 index 0269fc1b002..00000000000 --- a/spec/javascripts/cycle_analytics/total_time_component_spec.js +++ /dev/null @@ -1,58 +0,0 @@ -import Vue from 'vue'; -import mountComponent from 'spec/helpers/vue_mount_component_helper'; -import component from '~/cycle_analytics/components/total_time_component.vue'; - -describe('Total time component', () => { - let vm; - let Component; - - beforeEach(() => { - Component = Vue.extend(component); - }); - - afterEach(() => { - vm.$destroy(); - }); - - describe('With data', () => { - it('should render information for days and hours', () => { - vm = mountComponent(Component, { - time: { - days: 3, - hours: 4, - }, - }); - - expect(vm.$el.textContent.trim().replace(/\s\s+/g, ' ')).toEqual('3 days 4 hrs'); - }); - - it('should render information for hours and minutes', () => { - vm = mountComponent(Component, { - time: { - hours: 4, - mins: 35, - }, - }); - - expect(vm.$el.textContent.trim().replace(/\s\s+/g, ' ')).toEqual('4 hrs 35 mins'); - }); - - it('should render information for seconds', () => { - vm = mountComponent(Component, { - time: { - seconds: 45, - }, - }); - - expect(vm.$el.textContent.trim().replace(/\s\s+/g, ' ')).toEqual('45 s'); - }); - }); - - describe('Without data', () => { - it('should render no information', () => { - vm = mountComponent(Component); - - expect(vm.$el.textContent.trim()).toEqual('--'); - }); - }); -}); -- cgit v1.2.3