Skip to content

Commit 53a6fe8

Browse files
GHEMID-Mohamedjulien-f
authored andcommitted
feat(tests): render React tree returned by render function (#40)
1 parent c43db4a commit 53a6fe8

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/new.spec.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
const assert = require("assert");
66
const { createElement } = require("react");
7-
const { configure, mount } = require("enzyme");
7+
const { configure, mount, shallow } = require("enzyme");
88

99
const CircularComputedError = require("./_CircularComputedError");
1010
const { withStore } = require("./");
@@ -92,6 +92,13 @@ describe("withStore", () => {
9292
assert(isReadOnly(props));
9393
expect(ownProps(props)).toEqual(["bar"]);
9494
});
95+
96+
it("returns the React tree to render", () => {
97+
const wrapper = shallow(
98+
createElement(withStore({}, () => createElement("h1")))
99+
);
100+
expect(wrapper.getElement()).toEqual(createElement("h1"));
101+
});
95102
});
96103

97104
describe("computed", () => {

0 commit comments

Comments
 (0)