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/snippets/components/edit_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/snippets/components/edit_spec.js')
-rw-r--r-- | spec/frontend/snippets/components/edit_spec.js | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/spec/frontend/snippets/components/edit_spec.js b/spec/frontend/snippets/components/edit_spec.js index 80a8b8ec489..61424fa1eb2 100644 --- a/spec/frontend/snippets/components/edit_spec.js +++ b/spec/frontend/snippets/components/edit_spec.js @@ -1,7 +1,8 @@ import { GlLoadingIcon } from '@gitlab/ui'; -import { shallowMount, createLocalVue } from '@vue/test-utils'; +import { shallowMount } from '@vue/test-utils'; +import Vue, { nextTick } from 'vue'; import { merge } from 'lodash'; -import { nextTick } from 'vue'; + import VueApollo, { ApolloMutation } from 'vue-apollo'; import { useFakeDate } from 'helpers/fake_date'; import createMockApollo from 'helpers/mock_apollo_helper'; @@ -78,8 +79,7 @@ const getApiData = ({ blobActions: [], }); -const localVue = createLocalVue(); -localVue.use(VueApollo); +Vue.use(VueApollo); describe('Snippet Edit app', () => { useFakeDate(); @@ -141,7 +141,6 @@ describe('Snippet Edit app', () => { wrapper = shallowMount(SnippetEditApp, { apolloProvider, - localVue, stubs: { ApolloMutation, FormFooterActions, @@ -330,6 +329,7 @@ describe('Snippet Edit app', () => { mutateSpy.mockRejectedValue(TEST_API_ERROR); await createComponentAndSubmit(); + await nextTick(); }); it('should not redirect', () => { @@ -339,7 +339,7 @@ describe('Snippet Edit app', () => { it('should flash', () => { // Apollo automatically wraps the resolver's error in a NetworkError expect(createFlash).toHaveBeenCalledWith({ - message: `Can't update snippet: Network error: ${TEST_API_ERROR.message}`, + message: `Can't update snippet: ${TEST_API_ERROR.message}`, }); }); @@ -349,7 +349,7 @@ describe('Snippet Edit app', () => { // eslint-disable-next-line no-console expect(console.error).toHaveBeenCalledWith( '[gitlab] unexpected error while updating snippet', - expect.objectContaining({ message: `Network error: ${TEST_API_ERROR.message}` }), + expect.objectContaining({ message: `${TEST_API_ERROR.message}` }), ); }); }); |