import * as React from 'react';
import {
  render,
  screen
} from '@testing-library/react';
import '@testing-library/jest-dom';
import * as ButtonBase from '@tesseract-design/web-base-button';
import * as CheckControlBase from '@tesseract-design/web-base-checkcontrol';
import { ToggleButton } from '.';

jest.mock('@tesseract-design/web-base-button');
jest.mock('@tesseract-design/web-base-checkcontrol');

describe('ToggleButton', () => {
  it('should render a checkbox', () => {
    render(
      <ToggleButton />
    );
    const checkbox = screen.getByRole('checkbox');
    expect(checkbox).toBeInTheDocument();
  });

  it('should render an indeterminate checkbox', () => {
    render(
      <ToggleButton
        indeterminate
      />
    );
    const checkbox = screen.getByRole('checkbox');
    expect(checkbox).toHaveProperty('indeterminate', true);
  });
});
