"use strict";
var __webpack_exports__ = {};
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
require("react");
const client_namespaceObject = require("@tachybase/client");
const test_client_namespaceObject = require("@tachybase/test/client");
const DataSourceApplicationProvider_js_namespaceObject = require("../../components/DataSourceApplicationProvider.js");
const DataSourceProvider_js_namespaceObject = require("../../data-source/DataSourceProvider.js");
describe('CollectionDataSourceProvider', ()=>{
    test('should work', ()=>{
        const app = new client_namespaceObject.Application({
            dataSourceManager: {
                dataSources: [
                    {
                        key: 'a',
                        displayName: 'a'
                    }
                ]
            }
        });
        const Demo = ()=>{
            const name = (0, DataSourceProvider_js_namespaceObject.useDataSourceKey)();
            return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
                "data-testid": "content",
                children: name
            });
        };
        (0, test_client_namespaceObject.render)(/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(DataSourceApplicationProvider_js_namespaceObject.DataSourceApplicationProvider, {
            dataSourceManager: app.dataSourceManager,
            children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(DataSourceProvider_js_namespaceObject.DataSourceProvider, {
                dataSource: 'a',
                children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Demo, {})
            })
        }));
        expect(test_client_namespaceObject.screen.getByTestId('content')).toHaveTextContent('a');
    });
});
var __webpack_export_target__ = exports;
for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', {
    value: true
});
