import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__ from "react/jsx-runtime";
import "react";
import * as __WEBPACK_EXTERNAL_MODULE__tachybase_client__ from "@tachybase/client";
import * as __WEBPACK_EXTERNAL_MODULE__tachybase_test_client__ from "@tachybase/test/client";
function renderApp(name, designable) {
    const schema = {
        name: 'root',
        type: 'void',
        'x-component': 'CollectionDeletedPlaceholder',
        'x-component-props': {
            name,
            type: 'Collection'
        }
    };
    (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.render)(/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("div", {
        "data-testid": "app",
        children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__tachybase_client__.SchemaComponentProvider, {
            designable: designable,
            children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__tachybase_client__.SchemaComponent, {
                schema: schema,
                components: {
                    CollectionDeletedPlaceholder: __WEBPACK_EXTERNAL_MODULE__tachybase_client__.CollectionDeletedPlaceholder
                }
            })
        })
    }));
}
describe('CollectionDeletedPlaceholder', ()=>{
    test('name is undefined, render `Result` component', ()=>{
        renderApp(void 0, true);
        expect(document.body.innerHTML).toContain('ant-result');
    });
    describe('name exist', ()=>{
        test('designable: true, render `Result` component', ()=>{
            renderApp('test', true);
            expect(document.body.innerHTML).toContain('ant-result');
        });
        test('designable: false, render nothing', ()=>{
            renderApp('test', false);
            expect(__WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.screen.getByTestId('app').innerHTML.length).toBe(0);
        });
    });
});
