mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
feat: Test UserProfileTransactionList
This commit is contained in:
parent
913a4deff1
commit
c3457b409b
33
frontend/src/views/Pages/UserProfileTransactionList.spec.js
Normal file
33
frontend/src/views/Pages/UserProfileTransactionList.spec.js
Normal file
@ -0,0 +1,33 @@
|
||||
import { mount } from '@vue/test-utils'
|
||||
import UserProfileTransactionList from './UserProfileTransactionList'
|
||||
|
||||
const localVue = global.localVue
|
||||
|
||||
describe('UserProfileTransactionList', () => {
|
||||
let wrapper
|
||||
|
||||
const mocks = {
|
||||
$t: jest.fn((t) => t),
|
||||
}
|
||||
|
||||
const Wrapper = () => {
|
||||
return mount(UserProfileTransactionList, { localVue, mocks })
|
||||
}
|
||||
|
||||
describe('mount', () => {
|
||||
beforeEach(() => {
|
||||
wrapper = Wrapper()
|
||||
})
|
||||
|
||||
it('renders the transaction table', () => {
|
||||
expect(wrapper.findComponent({ name: 'GddTransactionList' }).exists()).toBeTruthy()
|
||||
})
|
||||
|
||||
it('emist update-transactions when update-transactions is called', async () => {
|
||||
wrapper.findComponent({ name: 'GddTransactionList' }).vm.$emit('update-transactions')
|
||||
expect(wrapper.emitted('update-transactions')).toEqual(
|
||||
expect.arrayContaining([expect.arrayContaining([{ firstPage: 1, items: 25 }])]),
|
||||
)
|
||||
})
|
||||
})
|
||||
})
|
||||
@ -19,12 +19,13 @@
|
||||
import GddTransactionList from './AccountOverview/GddTransactionList.vue'
|
||||
|
||||
export default {
|
||||
name: 'UserProfileTransactionList',
|
||||
components: {
|
||||
GddTransactionList,
|
||||
},
|
||||
props: {
|
||||
transactions: {
|
||||
default: [],
|
||||
default: () => [],
|
||||
},
|
||||
transactionCount: { type: Number, default: 0 },
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user