Skip to content

Commit

Permalink
fix: Change redirection method in genes entrypoint (#161) (#162)
Browse files Browse the repository at this point in the history
  • Loading branch information
gromdimon authored Oct 18, 2023
1 parent dfbe284 commit 903aa5f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions frontend/src/lib/test-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ export const setupMountedComponents = (
routes: routes
})
router.push = vi.fn()
router.replace = vi.fn()

// Create a testing pinia with the initial data.
const pinia = createTestingPinia({
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/GenesListView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ watch(
() => genesListStore.storeState,
(storeState) => {
if (storeState == StoreState.Redirect) {
router.push({
router.replace({
name: 'gene',
params: { searchTerm: genesListStore.redirectHgncId, genomeRelease: genomeReleaseRef.value }
})
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/views/__tests__/GenesListView.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,8 @@ describe.concurrent('GenesListView', async () => {
)

await nextTick()
expect(router.push).toHaveBeenCalledOnce()
expect(router.push).toHaveBeenCalledWith({
expect(router.replace).toHaveBeenCalledOnce()
expect(router.replace).toHaveBeenCalledWith({
name: 'gene',
params: { searchTerm: 'HGNC:3333', genomeRelease: 'grch37' }
})
Expand Down

0 comments on commit 903aa5f

Please sign in to comment.