diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-02-18 09:45:46 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-02-18 09:45:46 +0000 |
commit | a7b3560714b4d9cc4ab32dffcd1f74a284b93580 (patch) | |
tree | 7452bd5c3545c2fa67a28aa013835fb4fa071baf /spec/frontend/pipeline_editor/components/ui/pipeline_editor_messages_spec.js | |
parent | ee9173579ae56a3dbfe5afe9f9410c65bb327ca7 (diff) | |
download | gitlab-ce-a7b3560714b4d9cc4ab32dffcd1f74a284b93580.tar.gz |
Add latest changes from gitlab-org/gitlab@14-8-stable-eev14.8.0-rc42
Diffstat (limited to 'spec/frontend/pipeline_editor/components/ui/pipeline_editor_messages_spec.js')
-rw-r--r-- | spec/frontend/pipeline_editor/components/ui/pipeline_editor_messages_spec.js | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/spec/frontend/pipeline_editor/components/ui/pipeline_editor_messages_spec.js b/spec/frontend/pipeline_editor/components/ui/pipeline_editor_messages_spec.js index a55176ccd79..d9ecee31e83 100644 --- a/spec/frontend/pipeline_editor/components/ui/pipeline_editor_messages_spec.js +++ b/spec/frontend/pipeline_editor/components/ui/pipeline_editor_messages_spec.js @@ -8,6 +8,7 @@ import PipelineEditorMessages from '~/pipeline_editor/components/ui/pipeline_edi import { COMMIT_FAILURE, COMMIT_SUCCESS, + COMMIT_SUCCESS_WITH_REDIRECT, DEFAULT_FAILURE, DEFAULT_SUCCESS, LOAD_FAILURE_UNKNOWN, @@ -34,7 +35,13 @@ describe('Pipeline Editor messages', () => { it('shows a message for successful commit type', () => { createComponent({ successType: COMMIT_SUCCESS, showSuccess: true }); - expect(findAlert().text()).toBe(wrapper.vm.$options.successTexts[COMMIT_SUCCESS]); + expect(findAlert().text()).toBe(wrapper.vm.$options.success[COMMIT_SUCCESS]); + }); + + it('shows a message for successful commit with redirect type', () => { + createComponent({ successType: COMMIT_SUCCESS_WITH_REDIRECT, showSuccess: true }); + + expect(findAlert().text()).toBe(wrapper.vm.$options.success[COMMIT_SUCCESS_WITH_REDIRECT]); }); it('does not show alert when there is a successType but visibility is off', () => { @@ -46,7 +53,7 @@ describe('Pipeline Editor messages', () => { it('shows a success alert with default copy if `showSuccess` is true and the `successType` is not valid,', () => { createComponent({ successType: 'random', showSuccess: true }); - expect(findAlert().text()).toBe(wrapper.vm.$options.successTexts[DEFAULT_SUCCESS]); + expect(findAlert().text()).toBe(wrapper.vm.$options.success[DEFAULT_SUCCESS]); }); it('emit `hide-success` event when clicking on the dismiss button', async () => { @@ -71,7 +78,7 @@ describe('Pipeline Editor messages', () => { `('shows a message for $message', ({ failureType, expectedFailureType }) => { createComponent({ failureType, showFailure: true }); - expect(findAlert().text()).toBe(wrapper.vm.$options.errorTexts[expectedFailureType]); + expect(findAlert().text()).toBe(wrapper.vm.$options.errors[expectedFailureType]); }); it('show failure reasons when there are some', () => { |