mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
50 lines
1.0 KiB
JavaScript
50 lines
1.0 KiB
JavaScript
import { mount } from '@vue/test-utils'
|
|
import UserCardCoinAnimation from './UserCard_CoinAnimation'
|
|
|
|
const localVue = global.localVue
|
|
|
|
const mockAPIcall = jest.fn()
|
|
|
|
const toastErrorMock = jest.fn()
|
|
const toastSuccessMock = jest.fn()
|
|
const storeCommitMock = jest.fn()
|
|
|
|
describe('UserCard_CoinAnimation', () => {
|
|
let wrapper
|
|
|
|
const mocks = {
|
|
$t: jest.fn((t) => t),
|
|
$store: {
|
|
state: {
|
|
language: 'de',
|
|
},
|
|
commit: storeCommitMock,
|
|
},
|
|
$toasted: {
|
|
success: toastSuccessMock,
|
|
error: toastErrorMock,
|
|
},
|
|
$apollo: {
|
|
query: mockAPIcall,
|
|
},
|
|
}
|
|
|
|
const Wrapper = () => {
|
|
return mount(UserCardCoinAnimation, { localVue, mocks })
|
|
}
|
|
|
|
describe('mount', () => {
|
|
beforeEach(() => {
|
|
wrapper = Wrapper()
|
|
})
|
|
|
|
it('renders the component', () => {
|
|
expect(wrapper.find('div#formusercoinanimation').exists()).toBeTruthy()
|
|
})
|
|
|
|
it('has an edit BFormCheckbox switch', () => {
|
|
expect(wrapper.find('.Test-BFormCheckbox').exists()).toBeTruthy()
|
|
})
|
|
})
|
|
})
|