import { fireEvent, renderHook } from "@testing-library/react";
import { describe, expect, it, vi } from "vitest";
import { useScrollPosition } from "./index";
describe("useScrollPosition", () => {
    it("should update on scroll", () => {
        vi.useFakeTimers();
        let fn = vi.fn();
        renderHook(() => useScrollPosition(fn, { timeout: 100 }));
        // Simulate scroll
        fireEvent.scroll(window);
        vi.advanceTimersByTime(100);
        expect(fn).toHaveBeenCalledTimes(1);
        vi.useRealTimers();
    });
});
