import React from 'react';
import { render, screen, act } from '@testing-library/react';
import { Drawer } from './Drawer';
describe('Drawer tests', function () {
    it('unmounts children only after timeout', function () {
        jest.useFakeTimers();
        var rerender = render(React.createElement(Drawer, { open: true },
            React.createElement("div", null, "Content"))).rerender;
        screen.getByText('Content');
        rerender(React.createElement(Drawer, { open: false },
            React.createElement("div", null, "Content")));
        screen.getByText('Content');
        act(function () {
            jest.runAllTimers();
        });
        expect(screen.queryByText('Content')).not.toBeInTheDocument();
        jest.useRealTimers();
    });
});
