mirror of
https://github.com/IT4Change/gradido.git
synced 2026-01-20 20:01:31 +00:00
add unit tests for date row component
This commit is contained in:
parent
4675f1f9ca
commit
9a3d5a6663
44
frontend/src/components/TransactionRows/DateRow.spec.js
Normal file
44
frontend/src/components/TransactionRows/DateRow.spec.js
Normal file
@ -0,0 +1,44 @@
|
||||
import { mount } from '@vue/test-utils'
|
||||
import DateRow from './DateRow'
|
||||
|
||||
const localVue = global.localVue
|
||||
|
||||
const mocks = {
|
||||
$i18n: {
|
||||
locale: 'en',
|
||||
},
|
||||
$t: jest.fn((t) => t),
|
||||
$d: jest.fn((d) => d),
|
||||
}
|
||||
|
||||
const propsData = {
|
||||
date: '02.02.2020',
|
||||
}
|
||||
|
||||
describe('DateRow', () => {
|
||||
let wrapper
|
||||
|
||||
const Wrapper = () => {
|
||||
return mount(DateRow, { localVue, mocks, propsData })
|
||||
}
|
||||
|
||||
describe('mount', () => {
|
||||
beforeEach(() => {
|
||||
wrapper = Wrapper()
|
||||
})
|
||||
|
||||
it('renders the component', () => {
|
||||
expect(wrapper.find('div.date-row').exists()).toBe(true)
|
||||
})
|
||||
|
||||
it('shows the expiration text', () => {
|
||||
expect(wrapper.find('div.text-right').text()).toBe('form.date')
|
||||
})
|
||||
|
||||
it('shows the date in long format', () => {
|
||||
expect(wrapper.find('div.gdd-transaction-list-item-date').text()).toBe(
|
||||
'Sun Feb 02 2020 00:00:00 GMT+0000 (Koordinierte Weltzeit)',
|
||||
)
|
||||
})
|
||||
})
|
||||
})
|
||||
Loading…
x
Reference in New Issue
Block a user