diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-30 03:08:26 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-30 03:08:26 +0300 |
commit | d210b1bee140e0f2c1f09635dd14a872e07a3100 (patch) | |
tree | 65c5c0002ef2038e8a46d40067810923851b7926 /spec/frontend/profile | |
parent | 836ddfc35d1778675b3bd6d51f51972f36a96bbe (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/profile')
-rw-r--r-- | spec/frontend/profile/account/components/update_username_spec.js | 6 | ||||
-rw-r--r-- | spec/frontend/profile/preferences/components/profile_preferences_spec.js | 16 |
2 files changed, 14 insertions, 8 deletions
diff --git a/spec/frontend/profile/account/components/update_username_spec.js b/spec/frontend/profile/account/components/update_username_spec.js index e331eed1863..575df9fb3c0 100644 --- a/spec/frontend/profile/account/components/update_username_spec.js +++ b/spec/frontend/profile/account/components/update_username_spec.js @@ -3,7 +3,7 @@ import { shallowMount } from '@vue/test-utils'; import MockAdapter from 'axios-mock-adapter'; import { nextTick } from 'vue'; import { TEST_HOST } from 'helpers/test_constants'; -import createFlash from '~/flash'; +import { createAlert } from '~/flash'; import axios from '~/lib/utils/axios_utils'; import UpdateUsername from '~/profile/account/components/update_username.vue'; @@ -149,7 +149,7 @@ describe('UpdateUsername component', () => { await expect(wrapper.vm.onConfirm()).rejects.toThrow(); - expect(createFlash).toHaveBeenCalledWith({ + expect(createAlert).toHaveBeenCalledWith({ message: 'Invalid username', }); }); @@ -161,7 +161,7 @@ describe('UpdateUsername component', () => { await expect(wrapper.vm.onConfirm()).rejects.toThrow(); - expect(createFlash).toHaveBeenCalledWith({ + expect(createAlert).toHaveBeenCalledWith({ message: 'An error occurred while updating your username, please try again.', }); }); diff --git a/spec/frontend/profile/preferences/components/profile_preferences_spec.js b/spec/frontend/profile/preferences/components/profile_preferences_spec.js index 89ce838a383..91cd868daac 100644 --- a/spec/frontend/profile/preferences/components/profile_preferences_spec.js +++ b/spec/frontend/profile/preferences/components/profile_preferences_spec.js @@ -3,7 +3,7 @@ import { shallowMount } from '@vue/test-utils'; import { nextTick } from 'vue'; import { useMockLocationHelper } from 'helpers/mock_window_location_helper'; import { extendedWrapper } from 'helpers/vue_test_utils_helper'; -import createFlash from '~/flash'; +import { createAlert, VARIANT_DANGER, VARIANT_INFO } from '~/flash'; import IntegrationView from '~/profile/preferences/components/integration_view.vue'; import ProfilePreferences from '~/profile/preferences/components/profile_preferences.vue'; import { i18n } from '~/profile/preferences/constants'; @@ -149,7 +149,10 @@ describe('ProfilePreferences component', () => { const successEvent = new CustomEvent('ajax:success'); form.dispatchEvent(successEvent); - expect(createFlash).toHaveBeenCalledWith({ message: i18n.defaultSuccess, type: 'notice' }); + expect(createAlert).toHaveBeenCalledWith({ + message: i18n.defaultSuccess, + variant: VARIANT_INFO, + }); }); it('displays the custom success message', () => { @@ -157,14 +160,17 @@ describe('ProfilePreferences component', () => { const successEvent = new CustomEvent('ajax:success', { detail: [{ message }] }); form.dispatchEvent(successEvent); - expect(createFlash).toHaveBeenCalledWith({ message, type: 'notice' }); + expect(createAlert).toHaveBeenCalledWith({ message, variant: VARIANT_INFO }); }); it('displays the default error message', () => { const errorEvent = new CustomEvent('ajax:error'); form.dispatchEvent(errorEvent); - expect(createFlash).toHaveBeenCalledWith({ message: i18n.defaultError, type: 'alert' }); + expect(createAlert).toHaveBeenCalledWith({ + message: i18n.defaultError, + variant: VARIANT_DANGER, + }); }); it('displays the custom error message', () => { @@ -172,7 +178,7 @@ describe('ProfilePreferences component', () => { const errorEvent = new CustomEvent('ajax:error', { detail: [{ message }] }); form.dispatchEvent(errorEvent); - expect(createFlash).toHaveBeenCalledWith({ message, type: 'alert' }); + expect(createAlert).toHaveBeenCalledWith({ message, variant: VARIANT_DANGER }); }); }); |