|
| 1 | +import { PatchFlags } from "@vue/shared"; |
1 | 2 | import { mount } from "@vue/test-utils";
|
2 | 3 | import * as events from "devextreme/events";
|
3 |
| -import { App, defineComponent, nextTick } from "vue"; |
| 4 | +import { App, createVNode, defineComponent, h, nextTick, renderSlot } from "vue"; |
4 | 5 | import { createRouter, createWebHistory } from "vue-router";
|
5 | 6 |
|
| 7 | +import { pullConfigComponents } from "../children-processing"; |
6 | 8 | import { IWidgetComponent } from "../component";
|
7 | 9 | import globalConfig from "../config";
|
| 10 | +import Configuration from "../configuration"; |
8 | 11 | import { IConfigurable, IConfigurationComponent } from "../configuration-component";
|
9 | 12 | import { IExtension } from "../extension-component";
|
10 | 13 | import { createComponent, createConfigurationComponent, createExtensionComponent } from "../index";
|
@@ -1815,3 +1818,25 @@ describe("disposing", () => {
|
1815 | 1818 | expect(component.unmount.bind(component)).not.toThrow();
|
1816 | 1819 | });
|
1817 | 1820 | });
|
| 1821 | + |
| 1822 | +describe("children processing", () => { |
| 1823 | + it("should process children if they are wrapped to a bail container", () => { |
| 1824 | + const Nested = buildTestConfigCtor(); |
| 1825 | + const config = new Configuration( |
| 1826 | + () => undefined, |
| 1827 | + null, |
| 1828 | + {} |
| 1829 | + ); |
| 1830 | + (Nested as any as IConfigurationComponent).$_optionName = "nestedOption"; |
| 1831 | + const nestedVNode = createVNode(Nested); |
| 1832 | + const vnode = renderSlot( |
| 1833 | + { default: () => [nestedVNode] }, |
| 1834 | + "default", |
| 1835 | + undefined, |
| 1836 | + () => [(h("comment"))] |
| 1837 | + ); |
| 1838 | + expect(vnode.patchFlag).toBe(PatchFlags.BAIL); |
| 1839 | + pullConfigComponents([vnode], [], config); |
| 1840 | + expect(nestedVNode).toHaveProperty("$_config"); |
| 1841 | + }); |
| 1842 | +}); |
0 commit comments