We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1ebab32 commit 3f7e0aaCopy full SHA for 3f7e0aa
site/src/components/PaginationWidget/utils.test.ts
@@ -1,4 +1,4 @@
1
-import { buildPagedList } from "./utils"
+import { buildPagedList, getOffset } from "./utils"
2
3
describe("unit/PaginationWidget", () => {
4
describe("buildPagedList", () => {
@@ -27,3 +27,16 @@ describe("unit/PaginationWidget", () => {
27
)
28
})
29
30
+
31
+describe("getOffset", () => {
32
+ it("returns 0 on page 1", () => {
33
+ const page = 1
34
+ const limit = 10
35
+ expect(getOffset(page, limit)).toEqual(0)
36
+ })
37
+ it("returns the limit on page 2", () => {
38
+ const page = 2
39
40
+ expect(getOffset(page, limit)).toEqual(limit)
41
42
+})
0 commit comments