/* eslint-disable no-undef */
import React from 'react';
import { cleanup } from '@testing-library/react';
import '@testing-library/jest-dom';

import testWrapper from '../helpers/testWrapper';
import Dialog from '../components/Dialog';

describe('Dialog component', () => {
  afterEach(cleanup);

  test('check open status', () => {
    const { getByText } = testWrapper(<Dialog open>content</Dialog>);

    expect(getByText('content')).toBeVisible();
  });

  test('check close status', () => {
    const { queryByText } = testWrapper(<Dialog open={false}>content</Dialog>);

    expect(queryByText('content')).not.toBeInTheDocument();
  });
});
