mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
fixed test for pagination
This commit is contained in:
parent
895d785916
commit
1b88c23b05
@ -405,13 +405,13 @@ describe('GddTransactionList', () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe('change of currentPage', () => {
|
||||
describe('change of 2 currentPage', () => {
|
||||
beforeEach(async () => {
|
||||
wrapper.setData({ currentPage: 2 })
|
||||
})
|
||||
|
||||
describe('pagination buttons', () => {
|
||||
describe('updates transaction count < 25', () => {
|
||||
describe('updates transactionCount > 25', () => {
|
||||
beforeEach(async () => {
|
||||
const decayStartBlock = new Date(2001, 8, 9)
|
||||
await wrapper.setProps({
|
||||
@ -419,16 +419,44 @@ describe('GddTransactionList', () => {
|
||||
transactionCount: 26,
|
||||
decayStartBlock,
|
||||
pageSize: 25,
|
||||
showPagination: true,
|
||||
})
|
||||
})
|
||||
it('updates transaction transactionCount', () => {
|
||||
expect(wrapper.vm.transactionCount).toBe(26)
|
||||
})
|
||||
it('shows pagination buttons if transactionCount > pageSize', () => {
|
||||
it('shows pagination buttons if showPagination = true', () => {
|
||||
expect(wrapper.find('ul.pagination').exists()).toBe(true)
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('change of 1 currentPage', () => {
|
||||
beforeEach(async () => {
|
||||
wrapper.setData({ currentPage: 1 })
|
||||
})
|
||||
|
||||
describe('pagination buttons', () => {
|
||||
describe('updates transactionCount < 25', () => {
|
||||
beforeEach(async () => {
|
||||
const decayStartBlock = new Date(2001, 8, 9)
|
||||
await wrapper.setProps({
|
||||
transactions: [],
|
||||
transactionCount: 2,
|
||||
decayStartBlock,
|
||||
pageSize: 25,
|
||||
showPagination: false,
|
||||
})
|
||||
})
|
||||
it('updates transaction transactionCount', () => {
|
||||
expect(wrapper.vm.transactionCount).toBe(2)
|
||||
})
|
||||
it('shows pagination buttons if showPagination = true', () => {
|
||||
expect(wrapper.find('ul.pagination').exists()).toBe(false)
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user