typography.test.tsx 770 B

123456789101112131415161718192021222324252627
  1. /* eslint-disable import/no-extraneous-dependencies */
  2. /* eslint-disable no-undef */
  3. import React from 'react';
  4. import { render, cleanup } from '@testing-library/react';
  5. import '@testing-library/jest-dom';
  6. import Typography from '../components/Typography';
  7. describe('Typography component', () => {
  8. afterEach(cleanup);
  9. test('check title style', () => {
  10. const { getByText } = render(
  11. <Typography variant="title">title</Typography>
  12. );
  13. expect(getByText('title')).toHaveStyle('font-size: 16px;color: #000000;');
  14. });
  15. test('check subtitle style', () => {
  16. const { queryByText } = render(
  17. <Typography variant="subtitle">title</Typography>
  18. );
  19. expect(queryByText('title')).toHaveStyle('font-size: 14px;color: #000000;');
  20. });
  21. });