mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-18 06:44:46 -07:00
Test that last page can have less than the rest
This commit is contained in:
parent
dea22f7650
commit
ae0be1b78f
1 changed files with 9 additions and 2 deletions
|
|
@ -185,8 +185,8 @@ test('Can paginate', async (t) => {
|
||||||
const cases = [
|
const cases = [
|
||||||
{
|
{
|
||||||
from: {
|
from: {
|
||||||
list: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
|
list: [ 1, 2, 3, 4, 5, 6, 7, 8, 9 ],
|
||||||
perPage: 2,
|
perPage: 2
|
||||||
},
|
},
|
||||||
expect: {
|
expect: {
|
||||||
pageCount: 5,
|
pageCount: 5,
|
||||||
|
|
@ -200,6 +200,13 @@ test('Can paginate', async (t) => {
|
||||||
number: 2,
|
number: 2,
|
||||||
items: [3, 4],
|
items: [3, 4],
|
||||||
json: '[3,4]'
|
json: '[3,4]'
|
||||||
|
},
|
||||||
|
|
||||||
|
// Last page should have less than perPage items
|
||||||
|
{
|
||||||
|
number: 5,
|
||||||
|
items: [9],
|
||||||
|
json: '[9]'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue