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('TimePicker', ()=>{
    it('should display the value of user input', 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 input = container.querySelector('input');
        await __WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.userEvent.click(input);
        const submit = __WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.screen.getByText('OK');
        __WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.fireEvent.change(input, {
            target: {
                value: '12:00:00'
            }
        });
        await __WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.userEvent.click(submit);
        expect(input.value).toBe('12:00:00');
        expect(__WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.screen.getByText('12:00:00')).toBeInTheDocument();
    });
});
describe('TimePicker.RangePicker', ()=>{
    it('should display the value of user input', 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"], {}));
        const startInput = __WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.screen.getByPlaceholderText('Start time');
        const endInput = __WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.screen.getByPlaceholderText('End time');
        await __WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.userEvent.click(startInput);
        __WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.fireEvent.change(startInput, {
            target: {
                value: '12:00:00'
            }
        });
        await __WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.userEvent.click(__WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.screen.getByText('OK'));
        await __WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.userEvent.click(endInput);
        __WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.fireEvent.change(endInput, {
            target: {
                value: '14:00:00'
            }
        });
        await __WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.userEvent.click(__WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.screen.getByText('OK'));
        expect(startInput.value).toBe('12:00:00');
        expect(endInput.value).toBe('14:00:00');
        expect(__WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.screen.getByText('12:00:00~14:00:00')).toBeInTheDocument();
    });
});
