import { mount } from '@vue/test-utils' import UserCardLanguage from './UserCard_Language' const localVue = global.localVue const mockAPIcall = jest.fn() const toastErrorMock = jest.fn() const toastSuccessMock = jest.fn() const storeCommitMock = jest.fn() describe('UserCard_Language', () => { 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(UserCardLanguage, { localVue, mocks }) } describe('mount', () => { beforeEach(() => { wrapper = Wrapper() }) it('renders the component', () => { expect(wrapper.find('div#formuserlanguage').exists()).toBeTruthy() }) it('has an edit icon', () => { expect(wrapper.find('svg.bi-pencil').exists()).toBeTruthy() }) }) })