import React from 'react';
import {render} from '@shared/testingLibrary';

import {Checkbox} from './index';

describe('Checkbox component', () => {
  it('Check if title is rendered', () => {
    const {getByText} = render(<Checkbox title="Checkbox" />);
    expect(getByText('Checkbox')).toBeTruthy();
  });

  it('Checkbox is checked', () => {
    const {getAllByTestId} = render(<Checkbox title="Checkbox" checked />);
    expect(getAllByTestId('icon-checked')).toBeTruthy();
  });

  it('Checkbox is semiChecked', () => {
    const {getAllByTestId} = render(<Checkbox title="Checkbox" semiChecked />);
    expect(getAllByTestId('icon-semi-checked')).toBeTruthy();
  });
});
