|
- import * as React from 'react';
- import {
- render,
- screen
- } from '@testing-library/react';
- import '@testing-library/jest-dom';
- import * as CheckControlBase from '@tesseract-design/web-base-checkcontrol';
- import { ToggleTickBox } from '.';
-
- jest.mock('@tesseract-design/web-base-checkcontrol');
-
- describe('ToggleTickBox', () => {
- it('should render a checkbox', () => {
- render(
- <ToggleTickBox />
- );
- const checkbox = screen.getByRole('checkbox');
- expect(checkbox).toBeInTheDocument();
- });
-
- it('should render an indeterminate checkbox', () => {
- render(
- <ToggleTickBox
- indeterminate
- />
- );
- const checkbox = screen.getByRole('checkbox');
- expect(checkbox).toHaveProperty('indeterminate', true);
- });
- });
|