typography.test.tsx 717 B

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