Changed the loginAPI mock to the apollo mock.

This commit is contained in:
Hannes Heine 2021-08-10 14:53:45 +02:00
parent cc30b02389
commit 4531eb15cb

View File

@ -1,22 +1,15 @@
import { mount } from '@vue/test-utils'
import UserCardFormUserData from './UserCard_FormUserData'
import loginAPI from '../../../apis/loginAPI'
import flushPromises from 'flush-promises'
jest.mock('../../../apis/loginAPI')
const localVue = global.localVue
const mockAPIcall = jest.fn((args) => {
return { success: true }
})
const mockAPIcall = jest.fn()
const toastErrorMock = jest.fn()
const toastSuccessMock = jest.fn()
const storeCommitMock = jest.fn()
loginAPI.updateUserInfos = mockAPIcall
describe('UserCard_FormUsername', () => {
let wrapper
@ -36,6 +29,9 @@ describe('UserCard_FormUsername', () => {
success: toastSuccessMock,
error: toastErrorMock,
},
$apollo: {
query: mockAPIcall,
},
}
const Wrapper = () => {