Skip to content

Commit 872e47a

Browse files
committed
test: add direct text children for component
1 parent a1d0819 commit 872e47a

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

packages/runtime-core/__tests__/rendererComponent.spec.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,15 @@ describe("renderer: component", () => {
1212
render(h(Comp), root);
1313
expect(serializeInner(root)).toBe(`<div></div>`);
1414
});
15+
16+
it("should create an Component with direct text children", () => {
17+
const Comp = {
18+
render: () => {
19+
return h("div", null, "test");
20+
},
21+
};
22+
const root = nodeOps.createElement("div");
23+
render(h(Comp), root);
24+
expect(serializeInner(root)).toBe(`<div>test</div>`);
25+
});
1526
});

0 commit comments

Comments
 (0)