mirror of
https://github.com/IT4Change/gradido.git
synced 2026-03-01 12:44:43 +00:00
* fix(admin): update test files predeploy * fix(admin): update test files predeploy * fix(admin): update test files predeploy
55 lines
1.3 KiB
JavaScript
55 lines
1.3 KiB
JavaScript
import { mount, RouterLinkStub } from '@vue/test-utils'
|
|
import { describe, it, expect, beforeEach, vi } from 'vitest'
|
|
import GddTransactionListFooter from './GddTransactionListFooter'
|
|
import { BListGroup, BListGroupItem } from 'bootstrap-vue-next'
|
|
|
|
describe('GddTransactionListFooter', () => {
|
|
let wrapper
|
|
|
|
const global = {
|
|
mocks: {
|
|
$t: vi.fn((t) => t),
|
|
},
|
|
stubs: {
|
|
RouterLink: RouterLinkStub,
|
|
BListGroup,
|
|
BListGroupItem,
|
|
},
|
|
}
|
|
|
|
const mountComponent = (props = {}) => {
|
|
return mount(GddTransactionListFooter, {
|
|
props,
|
|
global,
|
|
})
|
|
}
|
|
|
|
describe('mount', () => {
|
|
beforeEach(() => {
|
|
wrapper = mountComponent()
|
|
})
|
|
|
|
it('renders the component', () => {
|
|
expect(wrapper.find('div').exists()).toBe(true)
|
|
})
|
|
|
|
it('contains no text when count is not provided', () => {
|
|
expect(wrapper.text()).toBe('')
|
|
})
|
|
})
|
|
|
|
describe('count property is greater than 5', () => {
|
|
beforeEach(() => {
|
|
wrapper = mountComponent({ 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')
|
|
})
|
|
})
|
|
})
|