"use strict";
var __webpack_exports__ = {};
const schema_namespaceObject = require("@tachybase/schema");
const external_useDesignable_js_namespaceObject = require("../useDesignable.js");
describe('splitWrapSchema', ()=>{
    test('case 1', ()=>{
        const wrap = new schema_namespaceObject.Schema({
            'x-uid': 'aaa',
            properties: {
                aa: {
                    'x-uid': 'aa',
                    properties: {
                        a: {
                            'x-uid': '123',
                            properties: {
                                bbb: {
                                    'x-uid': 'bbb'
                                }
                            }
                        }
                    }
                }
            }
        });
        const [schema1, schema2] = (0, external_useDesignable_js_namespaceObject.splitWrapSchema)(wrap, {
            ['x-uid']: 'aaa'
        });
        expect(schema1).toBeNull();
        expect(schema2).toMatchObject({
            'x-uid': 'aaa',
            properties: {
                aa: {
                    'x-uid': 'aa',
                    properties: {
                        a: {
                            'x-uid': '123',
                            properties: {
                                bbb: {
                                    'x-uid': 'bbb'
                                }
                            }
                        }
                    }
                }
            }
        });
    });
    test('case 2', ()=>{
        const wrap = new schema_namespaceObject.Schema({
            'x-uid': 'aaa',
            properties: {
                aa: {
                    'x-uid': 'aa',
                    properties: {
                        a: {
                            'x-uid': '123',
                            properties: {
                                bbb: {
                                    'x-uid': 'bbb'
                                }
                            }
                        }
                    }
                }
            }
        });
        const [schema1, schema2] = (0, external_useDesignable_js_namespaceObject.splitWrapSchema)(wrap, {
            ['x-uid']: '123'
        });
        expect(schema1).toMatchObject({
            'x-uid': 'aaa',
            properties: {
                aa: {
                    'x-uid': 'aa',
                    properties: {},
                    name: 'aa'
                }
            }
        });
        expect(schema2).toMatchObject({
            'x-uid': '123',
            properties: {
                bbb: {
                    'x-uid': 'bbb',
                    name: 'bbb'
                }
            },
            name: '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
});
