diff options
Diffstat (limited to 'spec/frontend/snippets/components/snippet_header_spec.js')
-rw-r--r-- | spec/frontend/snippets/components/snippet_header_spec.js | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/spec/frontend/snippets/components/snippet_header_spec.js b/spec/frontend/snippets/components/snippet_header_spec.js index 585614a6b79..e77bae79f68 100644 --- a/spec/frontend/snippets/components/snippet_header_spec.js +++ b/spec/frontend/snippets/components/snippet_header_spec.js @@ -1,12 +1,15 @@ import { GlButton, GlModal } from '@gitlab/ui'; import { mount } from '@vue/test-utils'; import { ApolloMutation } from 'vue-apollo'; +import { useMockLocationHelper } from 'helpers/mock_window_location_helper'; import waitForPromises from 'helpers/wait_for_promises'; import { Blob, BinaryBlob } from 'jest/blob/components/mock_data'; import { differenceInMilliseconds } from '~/lib/utils/datetime_utility'; import SnippetHeader from '~/snippets/components/snippet_header.vue'; import DeleteSnippetMutation from '~/snippets/mutations/deleteSnippet.mutation.graphql'; +useMockLocationHelper(); + describe('Snippet header component', () => { let wrapper; let snippet; @@ -200,19 +203,6 @@ describe('Snippet header component', () => { }); describe('Delete mutation', () => { - const { location } = window; - - beforeEach(() => { - delete window.location; - window.location = { - pathname: '', - }; - }); - - afterEach(() => { - window.location = location; - }); - it('dispatches a mutation to delete the snippet with correct variables', () => { createComponent(); wrapper.vm.deleteSnippet(); |