Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
preettier
  • Loading branch information
Kira-Pilot committed Jul 29, 2022
commit cf144f916c12c826cf1148d086884e068c332018
10 changes: 5 additions & 5 deletions site/src/components/PaginationWidget/buildPagedList.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import { buildPagedList } from "./PaginationWidget"

describe("unit/PaginationWidget", () => {
describe("buildPagedList", () => {
it.each<{ numPages: number, activePage: number, expected: (string | number)[] }>([
{ numPages: 7, activePage: 1, expected: [1,2,3,4,5,6,7] },
{ numPages: 17, activePage: 1, expected: [1,2,3,4,5,"right",17] },
{ numPages: 17, activePage: 9, expected: [1,"left",8,9,10,"right",17] },
{ numPages: 17, activePage: 17, expected: [1,"left",13,14,15,16,17] },
it.each<{ numPages: number; activePage: number; expected: (string | number)[] }>([
{ numPages: 7, activePage: 1, expected: [1, 2, 3, 4, 5, 6, 7] },
{ numPages: 17, activePage: 1, expected: [1, 2, 3, 4, 5, "right", 17] },
{ numPages: 17, activePage: 9, expected: [1, "left", 8, 9, 10, "right", 17] },
{ numPages: 17, activePage: 17, expected: [1, "left", 13, 14, 15, 16, 17] },
])(`buildPagedList($numPages, $activePage)`, ({ numPages, activePage, expected }) => {
expect(buildPagedList(numPages, activePage)).toEqual(expected)
})
Expand Down