/[sudobot]/trunk/tests/framework/pagination/Pagination.test.ts
ViewVC logotype

Diff of /trunk/tests/framework/pagination/Pagination.test.ts

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 631 by rakinar2, Tue Sep 10 15:53:22 2024 UTC revision 632 by rakinar2, Thu Oct 10 17:53:11 2024 UTC
# Line 1  Line 1 
1  import Pagination from "@framework/pagination/Pagination";  import Pagination from "@framework/widgets/Pagination";
2  import { describe, expect, it, vi } from "vitest";  import { describe, expect, it, vi } from "vitest";
3  import { createApplication } from "../../mocks/application.mock";  import { createApplication } from "../../mocks/application.mock";
4    
# Line 118  describe("Pagination", () => { Line 118  describe("Pagination", () => {
118    
119      it("should calculate max pages correctly", async () => {      it("should calculate max pages correctly", async () => {
120          const getCount = vi.fn().mockResolvedValue(15);          const getCount = vi.fn().mockResolvedValue(15);
121          const pagination = new Pagination(undefined, emojiResolver).setCountGetter(getCount).setLimit(5);          const pagination = new Pagination(undefined, emojiResolver)
122                .setCountGetter(getCount)
123                .setLimit(5);
124    
125          expect(await pagination["calculateMaxPages"].call(pagination)).toBe(3);          expect(await pagination["calculateMaxPages"].call(pagination)).toBe(3);
126      });      });

Legend:
Removed from v.631  
changed lines
  Added in v.632

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26