import { renderWithClient } from '../../../utils/test/react-query';
import { mockFailureResponse } from '../../../mocks/server';
import FinancialContainer from '../container';

describe('SettleRequestsContainer component', () => {
  test('successful render loader component', async () => {
    const result = renderWithClient(<FinancialContainer />);
    expect(await result.findByTestId('loader')).toBeInTheDocument();
  });

  test('successful render data', async () => {
    const result = renderWithClient(<FinancialContainer />);
    expect(await result.findByTestId('settle-requests')).toBeInTheDocument();
  });

  test('successful render error data', async () => {
    mockFailureResponse();
    const result = renderWithClient(<FinancialContainer />);
    expect(await result.findByTestId('error')).toBeInTheDocument();
  });
});
