-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "chore: map routes to tabs (#95)"
This reverts commit e5a0eb1.
- Loading branch information
Showing
19 changed files
with
308 additions
and
384 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
beforeEach(() => { | ||
cy.visit('/settings'); | ||
cy.visit('/'); | ||
|
||
cy.get('.nav-link').contains('Settings').click(); | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,23 @@ | ||
import './mocks/matchMedia.ts'; | ||
|
||
import {render} from '@testing-library/react'; | ||
import App from './App'; | ||
|
||
test('renders the app with no errors', () => { | ||
// window.matchMedia is not implemented in JSDOM so need to mock it | ||
// https://jestjs.io/docs/manual-mocks#mocking-methods-which-are-not-implemented-in-jsdom | ||
|
||
Object.defineProperty(window, 'matchMedia', { | ||
writable: true, | ||
value: vi.fn().mockImplementation((query) => ({ | ||
matches: false, | ||
media: query, | ||
onchange: null, | ||
addListener: vi.fn(), // deprecated | ||
removeListener: vi.fn(), // deprecated | ||
addEventListener: vi.fn(), | ||
removeEventListener: vi.fn(), | ||
dispatchEvent: vi.fn(), | ||
})), | ||
}); | ||
|
||
render(<App />); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,35 @@ | ||
import Header from './components/Header'; | ||
import {ThemeProvider} from './hooks/useTheme'; | ||
import Error from './pages/Error'; | ||
import Fixture from './pages/Fixture'; | ||
import Fixtures from './pages/Fixtures'; | ||
import Goal from './pages/Goal'; | ||
import Goals from './pages/Goals'; | ||
import Settings from './pages/Settings'; | ||
|
||
import {createBrowserRouter, Navigate, RouterProvider} from 'react-router-dom'; | ||
|
||
const router = createBrowserRouter([ | ||
{ | ||
element: <Header />, | ||
children: [ | ||
{ | ||
path: '/', | ||
element: <Navigate to="/goals" />, | ||
errorElement: <Error />, | ||
}, | ||
{ | ||
path: '/goals', | ||
element: <Goals />, | ||
errorElement: <Error />, | ||
}, | ||
{ | ||
path: '/fixtures', | ||
element: <Fixtures />, | ||
errorElement: <Error />, | ||
}, | ||
{ | ||
path: '/settings', | ||
element: <Settings />, | ||
errorElement: <Error />, | ||
}, | ||
{ | ||
path: '/goals/:goalId', | ||
element: <Goal />, | ||
errorElement: <Error />, | ||
}, | ||
{ | ||
path: '/fixtures/:fixtureId', | ||
element: <Fixture />, | ||
errorElement: <Error />, | ||
}, | ||
], | ||
path: '/', | ||
element: <Navigate to="/goals" />, | ||
errorElement: <Error />, | ||
}, | ||
{ | ||
path: '/goals', | ||
element: <Goals />, | ||
errorElement: <Error />, | ||
}, | ||
{ | ||
path: '/goals/:goalId', | ||
element: <Goal />, | ||
errorElement: <Error />, | ||
}, | ||
{ | ||
path: '/fixtures/:fixtureId', | ||
element: <Fixture />, | ||
errorElement: <Error />, | ||
}, | ||
]); | ||
|
||
function App() { | ||
return ( | ||
<ThemeProvider> | ||
<RouterProvider router={router} /> | ||
</ThemeProvider> | ||
); | ||
return <RouterProvider router={router} />; | ||
} | ||
|
||
export default App; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.