Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-02-25 00:09:08 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-25 00:09:08 +0300
commit7671216b60e2796a050358ff808b4a0c2de3d22f (patch)
tree605dfc1339a3cd7dc7353ac6d725191086a9acca /spec/frontend/blob
parentc2367afbf57ebc65d5b78a743b5d6a91f0aece9f (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/blob')
-rw-r--r--spec/frontend/blob/pipeline_tour_success_spec.js40
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);
+ });
+});