Website for showcasing all features of Tesseract Web.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
872 B

  1. import * as React from 'react';
  2. import {
  3. render,
  4. screen
  5. } from '@testing-library/react';
  6. import '@testing-library/jest-dom';
  7. import * as ButtonBase from '@tesseract-design/web-base-button';
  8. import * as CheckControlBase from '@tesseract-design/web-base-checkcontrol';
  9. import { ToggleButton } from '.';
  10. jest.mock('@tesseract-design/web-base-button');
  11. jest.mock('@tesseract-design/web-base-checkcontrol');
  12. describe('ToggleButton', () => {
  13. it('should render a checkbox', () => {
  14. render(
  15. <ToggleButton />
  16. );
  17. const checkbox = screen.getByRole('checkbox');
  18. expect(checkbox).toBeInTheDocument();
  19. });
  20. it('should render an indeterminate checkbox', () => {
  21. render(
  22. <ToggleButton
  23. indeterminate
  24. />
  25. );
  26. const checkbox = screen.getByRole('checkbox');
  27. expect(checkbox).toHaveProperty('indeterminate', true);
  28. });
  29. });