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";
import * as __WEBPACK_EXTERNAL_MODULE__demos_demo3_mjs__ from "../demos/demo3.mjs";
describe('Select', ()=>{
    it('select one', 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 selector = container.querySelector('.ant-select-selector');
        await __WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.userEvent.click(selector);
        expect(__WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.screen.getByText('福建')).toBeInTheDocument();
        expect(__WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.screen.getByText('江苏')).toBeInTheDocument();
        expect(__WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.screen.getByText('浙江')).toBeInTheDocument();
        expect(__WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.screen.getByText('福州')).toBeInTheDocument();
        expect(__WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.screen.getByText('莆田')).toBeInTheDocument();
        await __WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.userEvent.click(__WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.screen.getByText('福州'));
        expect(container.querySelectorAll('.ant-tag')).toHaveLength(1);
        expect(container.querySelector('.ant-tag')).toHaveTextContent('福州');
    });
    it('select multiple', 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 selector = container.querySelector('.ant-select-selector');
        await __WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.userEvent.click(selector);
        await __WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.userEvent.click(__WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.screen.getByText('福州'));
        await __WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.userEvent.click(selector);
        __WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.fireEvent.click(__WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.screen.getByText('浙江'));
        expect(__WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.screen.getAllByText('福州')).toHaveLength(3);
        expect(__WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.screen.getAllByText('浙江')).toHaveLength(3);
    });
    it('select one & objectValue: true', async ()=>{
        const { container } = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.render)(/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__demos_demo3_mjs__["default"], {}));
        const selector = container.querySelector('.ant-select-selector');
        expect(container.querySelectorAll('.ant-tag')).toHaveLength(1);
        expect(container.querySelector('.ant-tag')).toHaveTextContent('福州');
        await __WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.userEvent.click(selector);
        await __WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.userEvent.click(__WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.screen.getByText('莆田'));
        expect(container.querySelectorAll('.ant-tag')).toHaveLength(1);
        expect(container.querySelector('.ant-tag')).toHaveTextContent('莆田');
    });
});
