Skip to content

Commit d7845f5

Browse files
committed
One more test.
1 parent e5aa211 commit d7845f5

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

packages/wouter/test/router.test.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,15 @@ it("can extract `ssrSearch` from `ssrPath` after the '?' symbol", () => {
8989
expect(result.current.ssrSearch).toBe("a=b&c=d");
9090
});
9191

92+
it("keeps the ssrSearch undefined if not in SSR mode", () => {
93+
const { result } = renderHook(() => useRouter(), {
94+
wrapper: (props) => <Router>{props.children}</Router>,
95+
});
96+
97+
expect(result.current.ssrPath).toBe(undefined);
98+
expect(result.current.ssrSearch).toBe(undefined);
99+
});
100+
92101
it("shares one router instance between components", () => {
93102
const routers: any[] = [];
94103

0 commit comments

Comments
 (0)