summaryrefslogtreecommitdiff
path: root/spec/frontend/profile/preferences/components/profile_preferences_spec.js
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/profile/preferences/components/profile_preferences_spec.js')
-rw-r--r--spec/frontend/profile/preferences/components/profile_preferences_spec.js17
1 files changed, 3 insertions, 14 deletions
diff --git a/spec/frontend/profile/preferences/components/profile_preferences_spec.js b/spec/frontend/profile/preferences/components/profile_preferences_spec.js
index f1172a73d36..4d2dcf83d3b 100644
--- a/spec/frontend/profile/preferences/components/profile_preferences_spec.js
+++ b/spec/frontend/profile/preferences/components/profile_preferences_spec.js
@@ -1,6 +1,7 @@
import { GlButton } from '@gitlab/ui';
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 IntegrationView from '~/profile/preferences/components/integration_view.vue';
@@ -19,6 +20,8 @@ import {
jest.mock('~/flash');
const expectedUrl = '/foo';
+useMockLocationHelper();
+
describe('ProfilePreferences component', () => {
let wrapper;
const defaultProvide = {
@@ -174,8 +177,6 @@ describe('ProfilePreferences component', () => {
});
describe('theme changes', () => {
- const { location } = window;
-
let themeInput;
let form;
@@ -197,18 +198,6 @@ describe('ProfilePreferences component', () => {
form.dispatchEvent(successEvent);
}
- beforeAll(() => {
- delete window.location;
- window.location = {
- ...location,
- reload: jest.fn(),
- };
- });
-
- afterAll(() => {
- window.location = location;
- });
-
beforeEach(() => {
setupBody();
themeInput = createThemeInput();