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('FormV2', ()=>{
    it('basic', async ()=>{
        (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.render)(/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__demos_demo1_mjs__["default"], {}));
        let input, submit;
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.waitFor)(()=>{
            input = document.querySelector('.ant-input');
            submit = __WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.screen.getByText('Submit');
            expect(input).toBeInTheDocument();
            expect(__WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.screen.queryByText('Nickname')).toBeInTheDocument();
        });
        await __WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.userEvent.type(input, '李四');
        await __WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.userEvent.click(submit);
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.waitFor)(()=>{
            expect(__WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.screen.getByText(/\{"nickname":"李四"\}/i)).toBeInTheDocument();
        });
    });
    it('initial values', async ()=>{
        (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.render)(/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__demos_demo2_mjs__["default"], {}));
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.waitFor)(()=>{
            const nicknameInput = document.querySelector('.nickname .ant-input');
            const passwordInput = document.querySelector('.password .ant-input');
            const submit = __WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.screen.getByText('Submit');
            expect(submit).toBeInTheDocument();
            expect(nicknameInput).toBeInTheDocument();
            expect(passwordInput).toBeInTheDocument();
            expect(nicknameInput).toHaveValue('张三');
            expect(passwordInput).toHaveValue('123456');
            expect(__WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.screen.getByText('Nickname')).toBeInTheDocument();
            expect(__WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.screen.getByText('Password')).toBeInTheDocument();
        });
    });
    it('read pretty', async ()=>{
        (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.render)(/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__demos_demo3_mjs__["default"], {}));
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.waitFor)(()=>{
            expect(__WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.screen.getByText('Nickname')).toBeInTheDocument();
            expect(__WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.screen.getByText('Password')).toBeInTheDocument();
            expect(__WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.screen.getByText('张三')).toBeInTheDocument();
            expect(__WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.screen.getByText(/\*\*\*\*\*\*\*\*/i)).toBeInTheDocument();
        });
    });
});
