Skip to content

Commit f7f735a

Browse files
Jacob Buckmolefrog
authored andcommitted
Add separate test for falsy children in Switch
1 parent 1255892 commit f7f735a

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

test/switch.test.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,24 @@ it("ignores mixed children", () => {
4949
<Switch>
5050
Here is a<Route path="/users">route</Route>
5151
route
52+
</Switch>
53+
);
54+
55+
const rendered = result.children[0].children;
56+
57+
expect(rendered.length).toBe(1);
58+
expect(rendered[0].type).toBe(Route);
59+
});
60+
61+
it("ignores falsy children", () => {
62+
const result = testRouteRender(
63+
"/users",
64+
<Switch>
65+
{""}
66+
{false}
5267
{null}
68+
{undefined}
69+
<Route path="/users">route</Route>
5370
</Switch>
5471
);
5572

0 commit comments

Comments
 (0)