Skip to content

Commit

Permalink
Add from state to MemoryRouter in Tasks page test cases
Browse files Browse the repository at this point in the history
- Fix test case failure for redirect issue in task page
  • Loading branch information
royallsilwallz committed Nov 12, 2024
1 parent 5d2c434 commit 00400e4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion frontend/src/components/taskSelection/tests/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ describe('Contributions', () => {
return {
user: userEvent.setup(),
...render(
<MemoryRouter initialEntries={['/projects/122/tasks']}>
<MemoryRouter
initialEntries={[{ pathname: '/projects/123/tasks', state: { from: '/projects/123' } }]}
>
<Routes>
<Route
path="projects/:id/:tabname"
Expand Down
6 changes: 4 additions & 2 deletions frontend/src/views/tests/taskSelection.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ describe('Task Selection Page', () => {
return {
user: userEvent.setup(),
...render(
<MemoryRouter initialEntries={['/projects/123/tasks']}>
<MemoryRouter
initialEntries={[{ pathname: '/projects/123/tasks', state: { from: '/projects/123' } }]}
>
<Routes>
<Route
path="projects/:id/:tabname"
Expand Down Expand Up @@ -260,7 +262,7 @@ describe('Random Task Selection', () => {
return {
user: userEvent.setup(),
...render(
<MemoryRouter initialEntries={['/projects/963/tasks']}>
<MemoryRouter initialEntries={['/projects/963/instructions']}>
<Routes>
<Route
path="projects/:id/:tabname"
Expand Down

0 comments on commit 00400e4

Please sign in to comment.