import { renderHook } from '@testing-library/react';
import { describe, it, expect, vi, beforeEach } from 'vitest';
import { useRoutePreload } from './useRoutePreload';

describe('useRoutePreload', () => {
  beforeEach(() => {
    vi.clearAllMocks();
  });

  it('should return route preload hook', () => {
    const { result } = renderHook(() => useRoutePreload('/test-route'));

    expect(result.current).toBeDefined();
    // Le hook peut retourner différentes choses selon l'implémentation
    expect(result.current).toBeDefined();
  });

  it('should handle different routes', () => {
    const { result: result1 } = renderHook(() => useRoutePreload('/route1'));
    const { result: result2 } = renderHook(() =>
      useRoutePreload('/route2', 100),
    );

    expect(result1.current).toBeDefined();
    expect(result2.current).toBeDefined();
  });

  it('should handle delay parameter', () => {
    const { result } = renderHook(() => useRoutePreload('/test', 500));

    expect(result.current).toBeDefined();
  });
});
