mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
tests for pagenation exists
This commit is contained in:
parent
d488b037bd
commit
48b73c2515
@ -405,33 +405,22 @@ describe('GddTransactionList', () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe('pagination buttons', () => {
|
||||
/* const transactions = Array.from({ length: 42 }, (_, idx) => {
|
||||
return {
|
||||
amount: '3.14',
|
||||
balanceDate: '2021-04-29T17:26:40+00:00',
|
||||
decay: {},
|
||||
memo: 'Kreiszahl PI',
|
||||
linkedUser: {
|
||||
firstName: 'Bibi',
|
||||
lastName: 'Bloxberg',
|
||||
__typename: 'User',
|
||||
},
|
||||
id: idx + 1,
|
||||
typeId: 'RECEIVE',
|
||||
balance: '33.33',
|
||||
}
|
||||
})
|
||||
*/
|
||||
// describe('pagination buttons', () => {
|
||||
// describe('updates transaction count < 25', () => {
|
||||
// beforeEach(async () => {
|
||||
// await wrapper.setProps({
|
||||
// transactionCount: 2,
|
||||
// })
|
||||
// })
|
||||
|
||||
it('shows no pagination buttons if transactionCount < pageSize', () => {
|
||||
beforeEach(async () => {
|
||||
await wrapper.setProps({
|
||||
transactionCount: 2,
|
||||
})
|
||||
})
|
||||
expect(wrapper.find('div.pagination').exists()).toBe(false)
|
||||
})
|
||||
})
|
||||
// it('updates transaction count', () => {
|
||||
// expect(wrapper.vm.transactionCount).toBe(2)
|
||||
// })
|
||||
|
||||
// it('shows no pagination buttons if transactionCount < pageSize', () => {
|
||||
// expect(wrapper.find('div.pagination').exists()).toBe(false)
|
||||
// })
|
||||
// })
|
||||
// })
|
||||
})
|
||||
})
|
||||
|
||||
@ -166,25 +166,41 @@ describe('GdtTransactionList ', () => {
|
||||
}),
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
describe('pagination buttons', () => {
|
||||
it('shows the pagination buttons if transactionCount > pageSize', () => {
|
||||
beforeEach(async () => {
|
||||
await wrapper.setProps({
|
||||
transactionGdtCount: 42,
|
||||
describe('pagination buttons', () => {
|
||||
describe('with transactionCount > pageSize', () => {
|
||||
beforeEach(async () => {
|
||||
apolloMock.mockResolvedValue({
|
||||
data: {
|
||||
listGDTEntries: {
|
||||
count: 42,
|
||||
gdtEntries: [],
|
||||
},
|
||||
},
|
||||
})
|
||||
wrapper = Wrapper()
|
||||
})
|
||||
it('shows the pagination buttons', () => {
|
||||
expect(wrapper.find('ul.pagination').exists()).toBe(true)
|
||||
})
|
||||
})
|
||||
expect(wrapper.find('div.pagination').exists()).toBe(true)
|
||||
})
|
||||
|
||||
it('shows no the pagination buttons if transactionCount < pageSize', () => {
|
||||
beforeEach(async () => {
|
||||
await wrapper.setProps({
|
||||
transactionGdtCount: 2,
|
||||
describe('with transactionCount < pageSize', () => {
|
||||
beforeEach(async () => {
|
||||
apolloMock.mockResolvedValue({
|
||||
data: {
|
||||
listGDTEntries: {
|
||||
count: 2,
|
||||
gdtEntries: [],
|
||||
},
|
||||
},
|
||||
})
|
||||
wrapper = Wrapper()
|
||||
})
|
||||
it('shows no pagination buttons', () => {
|
||||
expect(wrapper.find('ul.pagination').exists()).toBe(false)
|
||||
})
|
||||
})
|
||||
expect(wrapper.find('div.pagination').exists()).toBe(false)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user