Skip to content

Commit 595c035

Browse files
committed
fix router tests
1 parent 55d28ed commit 595c035

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/utils/__tests__/polymorphic.test.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as React from "react";
22
import { render } from "@testing-library/react";
33
import type * as Polymorphic from "@reach/utils/polymorphic";
44
import type { RenderResult } from "@testing-library/react";
5-
import { Link as RouterLink } from "react-router-dom";
5+
import { Link as RouterLink, BrowserRouter } from "react-router-dom";
66

77
interface ButtonProps {
88
isDisabled?: boolean;
@@ -82,7 +82,7 @@ export function Test() {
8282
const buttonAsLinkRef = React.useRef<React.ElementRef<typeof Link>>(null);
8383

8484
return (
85-
<>
85+
<BrowserRouter>
8686
{/* Button accepts ref */}
8787
<Button ref={buttonRef} />
8888

@@ -206,7 +206,7 @@ export function Test() {
206206

207207
{/* Button as Anchor (Polymorphic.ForwardRefComponent) accepts requiredProp */}
208208
<Button as={Anchor} requiredProp />
209-
</>
209+
</BrowserRouter>
210210
);
211211
}
212212

0 commit comments

Comments
 (0)