diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-05 15:09:31 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-05 15:09:31 +0300 |
commit | 64f7eb2b37aebbb713463b2f6971b13191c1b0db (patch) | |
tree | 186ce376859dc04055a20d87945556eec63acd68 /spec/frontend/pipelines/empty_state_spec.js | |
parent | 315243f87739dd1edda2b75361f826abc91d4069 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/pipelines/empty_state_spec.js')
-rw-r--r-- | spec/frontend/pipelines/empty_state_spec.js | 105 |
1 files changed, 7 insertions, 98 deletions
diff --git a/spec/frontend/pipelines/empty_state_spec.js b/spec/frontend/pipelines/empty_state_spec.js index 7e42a3b5ae9..3ebedc9ac87 100644 --- a/spec/frontend/pipelines/empty_state_spec.js +++ b/spec/frontend/pipelines/empty_state_spec.js @@ -1,7 +1,5 @@ import { shallowMount } from '@vue/test-utils'; -import { withGonExperiment } from 'helpers/experimentation_helper'; import EmptyState from '~/pipelines/components/pipelines_list/empty_state.vue'; -import Tracking from '~/tracking'; describe('Pipelines Empty State', () => { let wrapper; @@ -40,104 +38,15 @@ describe('Pipelines Empty State', () => { expect(findGetStartedButton().attributes('href')).toBe('foo'); }); - describe('when in control group', () => { - it('should render empty state information', () => { - expect(findInfoText()).toContain( - 'Continuous Integration can help catch bugs by running your tests automatically', - 'while Continuous Deployment can help you deliver code to your product environment', - ); - }); - - it('should render a button', () => { - expect(findGetStartedButton().text()).toBe('Get started with Pipelines'); - }); - }); - - describe('when in experiment group', () => { - withGonExperiment('pipelinesEmptyState'); - - beforeEach(() => { - createWrapper(); - }); - - it('should render empty state information', () => { - expect(findInfoText()).toContain( - 'GitLab CI/CD can automatically build, test, and deploy your code. Let GitLab take care of time', - 'consuming tasks, so you can spend more time creating', - ); - }); - - it('should render button text', () => { - expect(findGetStartedButton().text()).toBe('Get started with CI/CD'); - }); + it('should render empty state information', () => { + expect(findInfoText()).toContain( + 'GitLab CI/CD can automatically build, test, and deploy your code. Let GitLab take care of time', + 'consuming tasks, so you can spend more time creating', + ); }); - describe('tracking', () => { - let origGon; - - describe('when data is set', () => { - beforeEach(() => { - jest.spyOn(Tracking, 'event').mockImplementation(() => {}); - origGon = window.gon; - - window.gon = { - tracking_data: { - category: 'Growth::Activation::Experiment::PipelinesEmptyState', - value: 1, - property: 'experimental_group', - label: 'label', - }, - }; - createWrapper(); - }); - - afterEach(() => { - window.gon = origGon; - }); - - it('tracks when mounted', () => { - expect(Tracking.event).toHaveBeenCalledWith( - 'Growth::Activation::Experiment::PipelinesEmptyState', - 'viewed', - { - value: 1, - label: 'label', - property: 'experimental_group', - }, - ); - }); - - it('tracks when button is clicked', () => { - findGetStartedButton().vm.$emit('click'); - - expect(Tracking.event).toHaveBeenCalledWith( - 'Growth::Activation::Experiment::PipelinesEmptyState', - 'documentation_clicked', - { - value: 1, - label: 'label', - property: 'experimental_group', - }, - ); - }); - }); - - describe('when no data is defined', () => { - beforeEach(() => { - jest.spyOn(Tracking, 'event').mockImplementation(() => {}); - - createWrapper(); - }); - - it('does not track on view', () => { - expect(Tracking.event).not.toHaveBeenCalled(); - }); - - it('does not track when button is clicked', () => { - findGetStartedButton().vm.$emit('click'); - expect(Tracking.event).not.toHaveBeenCalled(); - }); - }); + it('should render button text', () => { + expect(findGetStartedButton().text()).toBe('Get started with CI/CD'); }); }); }); |