mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Changed the mocks for the test.
This commit is contained in:
parent
e6ffd08db9
commit
a10f5a3bcc
@ -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 = () => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user