mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
test GddTransactionListFooter
This commit is contained in:
parent
173162fd2b
commit
b11b3c7752
@ -0,0 +1,48 @@
|
||||
import { mount, RouterLinkStub } from '@vue/test-utils'
|
||||
import GddTransactionListFooter from './GddTransactionListFooter'
|
||||
|
||||
const localVue = global.localVue
|
||||
|
||||
describe('GddTransactionListFooter', () => {
|
||||
let wrapper
|
||||
|
||||
const mocks = {
|
||||
$t: jest.fn((t) => t),
|
||||
}
|
||||
|
||||
const stubs = {
|
||||
RouterLink: RouterLinkStub,
|
||||
}
|
||||
|
||||
const Wrapper = () => {
|
||||
return mount(GddTransactionListFooter, { localVue, mocks, stubs })
|
||||
}
|
||||
|
||||
describe('mount', () => {
|
||||
beforeEach(() => {
|
||||
wrapper = Wrapper()
|
||||
})
|
||||
|
||||
it('renders the component', () => {
|
||||
expect(wrapper.find('div.list-group').exists()).toBeTruthy()
|
||||
})
|
||||
|
||||
it('contains no text', () => {
|
||||
expect(wrapper.text()).toBe('')
|
||||
})
|
||||
})
|
||||
|
||||
describe('count property is greater than 5', () => {
|
||||
beforeEach(async () => {
|
||||
wrapper.setProps({ count: 6 })
|
||||
})
|
||||
|
||||
it('renders a link to show all', () => {
|
||||
expect(wrapper.text()).toBe('transaction.show_all')
|
||||
})
|
||||
|
||||
it('links to /transactions', () => {
|
||||
expect(wrapper.findComponent(RouterLinkStub).props().to).toBe('/transactions')
|
||||
})
|
||||
})
|
||||
})
|
||||
Loading…
x
Reference in New Issue
Block a user