import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__ from "react/jsx-runtime";
import "react";
import * as __WEBPACK_EXTERNAL_MODULE__tachybase_test_client__ from "@tachybase/test/client";
import * as __WEBPACK_EXTERNAL_MODULE__demos_demo1_mjs__ from "../demos/demo1.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__demos_demo2_mjs__ from "../demos/demo2.mjs";
describe('Cascader', ()=>{
    it('sync', async ()=>{
        const { container } = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.render)(/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__demos_demo1_mjs__["default"], {}));
        const select = container.querySelector('.ant-select-selector');
        await __WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.userEvent.click(select);
        __WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.fireEvent.click(__WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.screen.getByText('Zhejiang'));
        __WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.fireEvent.click(__WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.screen.getByText('Hangzhou'));
        __WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.fireEvent.click(__WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.screen.getByText('West Lake'));
        expect(__WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.screen.getByText('Zhejiang /')).toBeInTheDocument();
        expect(__WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.screen.getByText('Hangzhou /')).toBeInTheDocument();
    });
    it('async', async ()=>{
        const { container } = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.render)(/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__demos_demo2_mjs__["default"], {}));
        const select = container.querySelector('.ant-select-selector');
        await __WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.userEvent.click(select);
        __WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.fireEvent.click(__WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.screen.getByText('Zhejiang'));
        expect(__WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.screen.queryByText('Zhejiang Dynamic 1')).not.toBeInTheDocument();
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.waitFor)(()=>{
            expect(__WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.screen.getByText('Zhejiang Dynamic 1')).toBeInTheDocument();
        });
        __WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.fireEvent.click(__WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.screen.getByText('Zhejiang Dynamic 1'));
        expect(__WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.screen.getByText('Zhejiang /')).toBeInTheDocument();
    });
});
