Skip to content

Commit

Permalink
test: add direct text children for component
Browse files Browse the repository at this point in the history
  • Loading branch information
cuixiaorui committed Jul 18, 2022
1 parent a1d0819 commit 872e47a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions packages/runtime-core/__tests__/rendererComponent.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,15 @@ describe("renderer: component", () => {
render(h(Comp), root);
expect(serializeInner(root)).toBe(`<div></div>`);
});

it("should create an Component with direct text children", () => {
const Comp = {
render: () => {
return h("div", null, "test");
},
};
const root = nodeOps.createElement("div");
render(h(Comp), root);
expect(serializeInner(root)).toBe(`<div>test</div>`);
});
});

0 comments on commit 872e47a

Please sign in to comment.