chore(react-router-v6): fixing broken test with the new router pattern

This commit is contained in:
blam
2020-06-11 21:03:04 +02:00
parent 0cd9a8a7d4
commit acfe3103dc
@@ -29,13 +29,12 @@ describe('<Link />', () => {
wrapInTestApp(
<Routes>
<Link to="/test">{linkText}</Link>
<Route path="/test">{testString}</Route>
<Route path="/test" element={<p>{testString}</p>} />
</Routes>,
),
);
expect(() => getByText(testString)).toThrow();
await act(async () => fireEvent.click(getByText(linkText)));
expect(getByText(testString)).toBeInTheDocument();
});
});