import { describe, it, expect } from 'vitest';
import { screen } from '@testing-library/react';
import { renderWithProviders } from './renderWithProviders';

function DummyPage() {
  return <div data-testid="dummy">Hello Test</div>;
}

describe('renderWithProviders', () => {
  it('renders child component', () => {
    renderWithProviders(<DummyPage />);
    expect(screen.getByTestId('dummy')).toHaveTextContent('Hello Test');
  });

  it('wraps with MemoryRouter — Link renders without error', () => {
    function PageWithLink() {
      return (
        <div>
          <a href="/test">Go</a>
        </div>
      );
    }
    renderWithProviders(<PageWithLink />);
    expect(screen.getByText('Go')).toHaveAttribute('href', '/test');
  });
});
