import * as __WEBPACK_EXTERNAL_MODULE__testing_library_react__ from "@testing-library/react";
import * as __WEBPACK_EXTERNAL_MODULE__usePagination_mjs__ from "./usePagination.mjs";
describe('usePagination', ()=>{
    test('initializes correctly with default parameters', ()=>{
        const { result } = (0, __WEBPACK_EXTERNAL_MODULE__testing_library_react__.renderHook)(()=>(0, __WEBPACK_EXTERNAL_MODULE__usePagination_mjs__.usePagination)({
                totalCount: 100,
                pageSize: 10,
                currentPage: 1
            }));
        expect(result.current.pages).not.toBeNull();
        expect(result.current.totalPageCount).toBe(10);
    });
    test('calculates total page count correctly', ()=>{
        const { result } = (0, __WEBPACK_EXTERNAL_MODULE__testing_library_react__.renderHook)(()=>(0, __WEBPACK_EXTERNAL_MODULE__usePagination_mjs__.usePagination)({
                totalCount: 45,
                pageSize: 10,
                currentPage: 1
            }));
        expect(result.current.totalPageCount).toBe(5);
    });
    test('pagination range for few pages', ()=>{
        const { result } = (0, __WEBPACK_EXTERNAL_MODULE__testing_library_react__.renderHook)(()=>(0, __WEBPACK_EXTERNAL_MODULE__usePagination_mjs__.usePagination)({
                totalCount: 30,
                pageSize: 10,
                currentPage: 2
            }));
        expect(result.current.pages).toEqual([
            1,
            2,
            3
        ]);
    });
    test('left dots appear when expected', ()=>{
        const { result } = (0, __WEBPACK_EXTERNAL_MODULE__testing_library_react__.renderHook)(()=>(0, __WEBPACK_EXTERNAL_MODULE__usePagination_mjs__.usePagination)({
                totalCount: 100,
                pageSize: 10,
                currentPage: 8
            }));
        expect(result.current.pages).toContain(null);
        expect(result.current.pages[0]).toBe(1);
        expect(result.current.pages[1]).toBe(null);
    });
    test('right dots appear when expected', ()=>{
        const { result } = (0, __WEBPACK_EXTERNAL_MODULE__testing_library_react__.renderHook)(()=>(0, __WEBPACK_EXTERNAL_MODULE__usePagination_mjs__.usePagination)({
                totalCount: 100,
                pageSize: 10,
                currentPage: 3
            }));
        expect(result.current.pages).toContain(null);
        expect(result.current.pages[result.current.pages.length - 1]).toBe(10);
        expect(result.current.pages[result.current.pages.length - 2]).toBe(null);
    });
    test('both dots appear when expected', ()=>{
        const { result } = (0, __WEBPACK_EXTERNAL_MODULE__testing_library_react__.renderHook)(()=>(0, __WEBPACK_EXTERNAL_MODULE__usePagination_mjs__.usePagination)({
                totalCount: 100,
                pageSize: 10,
                currentPage: 5
            }));
        expect(result.current.pages).toContain(null);
        expect(result.current.pages[0]).toBe(1);
        expect(result.current.pages[1]).toBe(null);
        expect(result.current.pages[result.current.pages.length - 2]).toBe(null);
        expect(result.current.pages[result.current.pages.length - 1]).toBe(10);
    });
    test('no dots scenario', ()=>{
        const { result } = (0, __WEBPACK_EXTERNAL_MODULE__testing_library_react__.renderHook)(()=>(0, __WEBPACK_EXTERNAL_MODULE__usePagination_mjs__.usePagination)({
                totalCount: 50,
                pageSize: 10,
                currentPage: 3
            }));
        expect(result.current.pages).not.toContain(null);
        expect(result.current.pages).toEqual([
            1,
            2,
            3,
            4,
            5
        ]);
    });
});
