import { MemoryRouter } from 'react-router-dom';
import LoginPage, { LOGIN_PAGE_TITLE } from '../index';
import { renderWithClient } from '../../../utils/test/react-query';
import { expectPageTestIds, expectPageTitle } from '../../../utils/test/expects';

describe('LoginPage Component', () => {
  test('successful render component', async () => {
    const result = renderWithClient(<LoginPage />, MemoryRouter);
    expectPageTitle(LOGIN_PAGE_TITLE);
    await expectPageTestIds(result);
    expect(await result.findByTestId('login-form')).toBeInTheDocument();
    expect(await result.findByText('ورود')).toBeInTheDocument();
  });
});
