mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
41 lines
919 B
JavaScript
41 lines
919 B
JavaScript
import { mount } from '@vue/test-utils'
|
|
import UserCard from './UserCard'
|
|
|
|
const localVue = global.localVue
|
|
|
|
describe('UserCard', () => {
|
|
let wrapper
|
|
|
|
const mocks = {
|
|
$t: jest.fn((t) => t),
|
|
$n: jest.fn((n) => String(n)),
|
|
$store: {
|
|
state: {
|
|
firstName: 'Bibi',
|
|
lastName: 'Bloxberg',
|
|
},
|
|
},
|
|
}
|
|
|
|
const Wrapper = () => {
|
|
return mount(UserCard, { localVue, mocks })
|
|
}
|
|
|
|
describe('mount', () => {
|
|
beforeEach(() => {
|
|
wrapper = Wrapper()
|
|
})
|
|
|
|
it('renders the Div Element ".userdata-card"', () => {
|
|
expect(wrapper.find('div.userdata-card').exists()).toBeTruthy()
|
|
})
|
|
it('renders the SPAN Element ".b-avatar"', () => {
|
|
expect(wrapper.find('span.b-avatar').exists()).toBeTruthy()
|
|
})
|
|
|
|
it('find the first letters of the firstName and lastName', () => {
|
|
expect(wrapper.find('span.b-avatar').text()).toBe('B B')
|
|
})
|
|
})
|
|
})
|