import { renderWithClient } from '../../../../utils/test/react-query';
import SettleRequest from '../index';

describe('SettleRequest component', () => {
  test('successful render create settle request form', async () => {
    const result = renderWithClient(<SettleRequest hasPendingSettleRequest={false} />);
    expect(await result.findByTestId('settle-request')).toBeInTheDocument();
    expect(await result.findByTestId('create-settle-request')).toBeInTheDocument();
    expect(await result.findByTestId('create-settle-request-form')).toBeInTheDocument();
  });
  
  test('successful render message if pending settle request exists', async () => {
    const result = renderWithClient(<SettleRequest hasPendingSettleRequest />);
    expect(await result.findByTestId('settle-request')).toBeInTheDocument();
    expect(await result.findByTestId('pending-settle-request-exists')).toBeInTheDocument();
  });
});
