dialog.test.tsx 648 B

1234567891011121314151617181920212223
  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 Dialog from '../components/Dialog';
  7. describe('Dialog component', () => {
  8. afterEach(cleanup);
  9. test('check open status', () => {
  10. const { getByText } = testWrapper(<Dialog open>content</Dialog>);
  11. expect(getByText('content')).toBeVisible();
  12. });
  13. test('check close status', () => {
  14. const { queryByText } = testWrapper(<Dialog open={false}>content</Dialog>);
  15. expect(queryByText('content')).not.toBeInTheDocument();
  16. });
  17. });