import { renderHook } from '@testing-library/react-hooks';
import useQueryParams from '../use-query-params';
import { createRouterWrapper } from '../../../utils/test/react-router-dom';

describe('useQueryParams hook', () => {
  test('useQueryParams works correctly', async () => {
    const { result } = renderHook(() => useQueryParams(), {
      wrapper: createRouterWrapper('?next=login')
    });
    expect(result.current).toStrictEqual({ next: 'login' });
  });
});
