12345678910111213141516171819202122 |
- /* eslint-disable no-undef */
- import React from 'react';
- import { render, cleanup } from '@testing-library/react';
- import '@testing-library/jest-dom';
- import Dialog from '../components/Dialog';
- describe('Dialog component', () => {
- afterEach(cleanup);
- test('check open status', () => {
- const { getByText } = render(<Dialog open>content</Dialog>);
- expect(getByText('content')).toBeVisible();
- });
- test('check close status', () => {
- const { queryByText } = render(<Dialog open={false}>content</Dialog>);
- expect(queryByText('content')).not.toBeInTheDocument();
- });
- });
|