"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var react_1 = __importDefault(require("react"));
var react_2 = require("@testing-library/react");
var Drawer_1 = require("./Drawer");
describe('Drawer tests', function () {
    it('unmounts children only after timeout', function () {
        jest.useFakeTimers();
        var rerender = (0, react_2.render)(react_1.default.createElement(Drawer_1.Drawer, { open: true },
            react_1.default.createElement("div", null, "Content"))).rerender;
        react_2.screen.getByText('Content');
        rerender(react_1.default.createElement(Drawer_1.Drawer, { open: false },
            react_1.default.createElement("div", null, "Content")));
        react_2.screen.getByText('Content');
        (0, react_2.act)(function () {
            jest.runAllTimers();
        });
        expect(react_2.screen.queryByText('Content')).not.toBeInTheDocument();
        jest.useRealTimers();
    });
});
