Commit d3f2379
committed
fix: layout test by using useLocation consistently from react-router-dom
The Layout.test.tsx broke in github run tests with:
```
FAIL src/domain/app/__tests__/Layout.test.tsx > renders without crashing
Error: useLocation() may be used only in the context of a <Router>
component.
❯ invariant node_modules/react-router/dist/development/index.js:327:11
325| function invariant(value, message) {
326| if (value === false || value === null || typeof value === "un
327| throw new Error(message);
| ^
328| }
329| }
❯ useLocation node_modules/react-router/dist/development/index.js:4229:
❯ useCmsLanguageOptions src/hooks/useCmsLanguageOptions.ts:11:20
❯ Navigation src/domain/app/navigation/Navigation.tsx:21:30
❯ renderWithHooks node_modules/react-dom/cjs/react-dom.development.js:1
❯ mountIndeterminateComponent node_modules/react-dom/cjs/react-dom.deve
❯ beginWork node_modules/react-dom/cjs/react-dom.development.js:21626:1
❯ beginWork$1 node_modules/react-dom/cjs/react-dom.development.js:27465
❯ performUnitOfWork node_modules/react-dom/cjs/react-dom.development.js
❯ workLoopSync node_modules/react-dom/cjs/react-dom.development.js:2650
```
Importing useLocation consistently from react-router-dom, previously
it was imported mostly from react-router-dom but once from react-router1 parent ed32114 commit d3f2379
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
0 commit comments