typography.test.tsx 800 B

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