diff --git a/frontend/src/views/Pages/UserProfile/UserCard_FormUsername.spec.js b/frontend/src/views/Pages/UserProfile/UserCard_FormUsername.spec.js index 3227895ad..eeec4b13d 100644 --- a/frontend/src/views/Pages/UserProfile/UserCard_FormUsername.spec.js +++ b/frontend/src/views/Pages/UserProfile/UserCard_FormUsername.spec.js @@ -1,16 +1,11 @@ import { mount } from '@vue/test-utils' import UserCardFormUsername from './UserCard_FormUsername' -import loginAPI from '../../../apis/loginAPI' import flushPromises from 'flush-promises' import { extend } from 'vee-validate' -jest.mock('../../../apis/loginAPI') - const localVue = global.localVue -const mockAPIcall = jest.fn((args) => { - return { success: true } -}) +const mockAPIcall = jest.fn() // override this rule to avoid API call extend('gddUsernameUnique', { @@ -23,8 +18,6 @@ const toastErrorMock = jest.fn() const toastSuccessMock = jest.fn() const storeCommitMock = jest.fn() -loginAPI.changeUsernameProfile = mockAPIcall - describe('UserCard_FormUsername', () => { let wrapper @@ -42,6 +35,9 @@ describe('UserCard_FormUsername', () => { success: toastSuccessMock, error: toastErrorMock, }, + $apollo: { + query: mockAPIcall, + }, } const Wrapper = () => {