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";
import * as __WEBPACK_EXTERNAL_MODULE__components_DataSourceApplicationProvider_mjs__ from "../../components/DataSourceApplicationProvider.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__data_source_DataSourceProvider_mjs__ from "../../data-source/DataSourceProvider.mjs";
describe('CollectionDataSourceProvider', ()=>{
    test('should work', ()=>{
        const app = new __WEBPACK_EXTERNAL_MODULE__tachybase_client__.Application({
            dataSourceManager: {
                dataSources: [
                    {
                        key: 'a',
                        displayName: 'a'
                    }
                ]
            }
        });
        const Demo = ()=>{
            const name = (0, __WEBPACK_EXTERNAL_MODULE__data_source_DataSourceProvider_mjs__.useDataSourceKey)();
            return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("div", {
                "data-testid": "content",
                children: name
            });
        };
        (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.render)(/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__components_DataSourceApplicationProvider_mjs__.DataSourceApplicationProvider, {
            dataSourceManager: app.dataSourceManager,
            children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__data_source_DataSourceProvider_mjs__.DataSourceProvider, {
                dataSource: 'a',
                children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(Demo, {})
            })
        }));
        expect(__WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.screen.getByTestId('content')).toHaveTextContent('a');
    });
});
