diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-24 21:09:08 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-24 21:09:08 +0000 |
commit | 7671216b60e2796a050358ff808b4a0c2de3d22f (patch) | |
tree | 605dfc1339a3cd7dc7353ac6d725191086a9acca /spec/frontend/blob | |
parent | c2367afbf57ebc65d5b78a743b5d6a91f0aece9f (diff) | |
download | gitlab-ce-7671216b60e2796a050358ff808b4a0c2de3d22f.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/blob')
-rw-r--r-- | spec/frontend/blob/pipeline_tour_success_spec.js | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/spec/frontend/blob/pipeline_tour_success_spec.js b/spec/frontend/blob/pipeline_tour_success_spec.js new file mode 100644 index 00000000000..f6783b31a73 --- /dev/null +++ b/spec/frontend/blob/pipeline_tour_success_spec.js @@ -0,0 +1,40 @@ +import pipelineTourSuccess from '~/blob/pipeline_tour_success_modal.vue'; +import { shallowMount } from '@vue/test-utils'; +import Cookies from 'js-cookie'; +import { GlSprintf, GlModal } from '@gitlab/ui'; + +describe('PipelineTourSuccessModal', () => { + let wrapper; + let cookieSpy; + const goToPipelinesPath = 'some_pipeline_path'; + const commitCookie = 'some_cookie'; + + beforeEach(() => { + wrapper = shallowMount(pipelineTourSuccess, { + propsData: { + goToPipelinesPath, + commitCookie, + }, + }); + + cookieSpy = jest.spyOn(Cookies, 'remove'); + }); + + afterEach(() => { + wrapper.destroy(); + }); + + it('has expected structure', () => { + const modal = wrapper.find(GlModal); + const sprintf = modal.find(GlSprintf); + + expect(modal.attributes('title')).toContain("That's it, well done!"); + expect(sprintf.exists()).toBe(true); + }); + + it('calls to remove cookie', () => { + wrapper.vm.disableModalFromRenderingAgain(); + + expect(cookieSpy).toHaveBeenCalledWith(commitCookie); + }); +}); |