mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Add test for invisible pagination buttons
This commit is contained in:
parent
9f2d1c4c74
commit
6b9fbc920e
@ -127,7 +127,6 @@ bobsSendings.forEach((sending) => {
|
|||||||
confirmed: true,
|
confirmed: true,
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
// Wolle: console.log('bobsSum: ', bobsSum)
|
|
||||||
|
|
||||||
export const creations: CreationInterface[] = [
|
export const creations: CreationInterface[] = [
|
||||||
{
|
{
|
||||||
|
|||||||
@ -407,9 +407,7 @@ describe('GddTransactionList', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
describe('pagination buttons', () => {
|
describe('pagination buttons', () => {
|
||||||
beforeEach(async () => {
|
const createTransaction = (idx) => {
|
||||||
await wrapper.setProps({
|
|
||||||
transactions: Array.from({ length: 42 }, (_, idx) => {
|
|
||||||
return {
|
return {
|
||||||
amount: '3.14',
|
amount: '3.14',
|
||||||
balanceDate: '2021-04-29T17:26:40+00:00',
|
balanceDate: '2021-04-29T17:26:40+00:00',
|
||||||
@ -428,8 +426,15 @@ describe('GddTransactionList', () => {
|
|||||||
typeId: 'RECEIVE',
|
typeId: 'RECEIVE',
|
||||||
balance: '33.33',
|
balance: '33.33',
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
const transactionCount = 42
|
||||||
|
await wrapper.setProps({
|
||||||
|
transactions: Array.from({ length: transactionCount }, (_, idx) => {
|
||||||
|
return createTransaction(idx)
|
||||||
}),
|
}),
|
||||||
transactionCount: 42,
|
transactionCount,
|
||||||
decayStartBlock,
|
decayStartBlock,
|
||||||
pageSize: 25,
|
pageSize: 25,
|
||||||
showPagination: true,
|
showPagination: true,
|
||||||
@ -449,23 +454,15 @@ describe('GddTransactionList', () => {
|
|||||||
)
|
)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
|
||||||
|
|
||||||
describe.skip('show no pagination', () => {
|
|
||||||
// Wolle: beforeEach(async () => {
|
|
||||||
// await wrapper.setProps({
|
|
||||||
// transactions: [],
|
|
||||||
// transactionCount: 2,
|
|
||||||
// decayStartBlock,
|
|
||||||
// pageSize: 25,
|
|
||||||
// showPagination: false,
|
|
||||||
// })
|
|
||||||
// })
|
|
||||||
|
|
||||||
|
describe('show no pagination', () => {
|
||||||
it('shows no pagination buttons', async () => {
|
it('shows no pagination buttons', async () => {
|
||||||
|
const transactionCount = 2
|
||||||
await wrapper.setProps({
|
await wrapper.setProps({
|
||||||
transactions: [],
|
transactions: Array.from({ length: transactionCount }, (_, idx) => {
|
||||||
transactionCount: 2,
|
return createTransaction(idx)
|
||||||
|
}),
|
||||||
|
transactionCount,
|
||||||
decayStartBlock,
|
decayStartBlock,
|
||||||
pageSize: 25,
|
pageSize: 25,
|
||||||
showPagination: false,
|
showPagination: false,
|
||||||
@ -474,4 +471,5 @@ describe('GddTransactionList', () => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@ -125,10 +125,6 @@ export default {
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
isPaginationVisible() {
|
isPaginationVisible() {
|
||||||
// Wolle: console.log('this.showPagination: ', this.showPagination)
|
|
||||||
// console.log('this.pageSize: ', this.pageSize)
|
|
||||||
// console.log('this.transactions.length: ', this.transactions.length)
|
|
||||||
// console.log('this.transactionCount: ', this.transactionCount)
|
|
||||||
return this.showPagination && this.pageSize < this.transactionCount
|
return this.showPagination && this.pageSize < this.transactionCount
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -143,6 +139,7 @@ export default {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
collaps-icon {
|
collaps-icon {
|
||||||
width: 95%;
|
width: 95%;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user