import { render } from '../../../utils/theme-render-wrapper';
import { Checkbox } from './checkbox';

describe('<Checkbox />', () => {
  it('should render successfully', () => {
    const { baseElement } = render(
      <Checkbox
        formControlLabelProps={{
          label: ''
        }}
      />
    );
    expect(baseElement).toBeTruthy();
  });

  it('should render checkbox with label', () => {
    const labelText = 'test';
    const { queryByTestId } = render(
      <Checkbox
        formControlLabelProps={{
          label: labelText
        }}
      />
    );
    expect(queryByTestId('checkboxFormWrapper')?.textContent).toBe(labelText);
  });

  it(`should render without label`, () => {
    const { baseElement } = render(<Checkbox />);
    expect(baseElement).toBeTruthy();
  });
});
