fix: make sure redirects to a saved view work as intended

This commit is contained in:
kolaente
2023-03-14 14:04:23 +00:00
committed by Gitea
parent 24b4576c00
commit a64c0c19e5
2 changed files with 3 additions and 1 deletions
+2
View File
@@ -35,9 +35,11 @@ describe('Projects', () => {
})
it('Should redirect to a specific project view after visited', () => {
cy.intercept(Cypress.env('API_URL') + '/projects/*/buckets*').as('loadBuckets')
cy.visit('/projects/1/kanban')
cy.url()
.should('contain', '/projects/1/kanban')
cy.wait('@loadBuckets')
cy.visit('/projects/1')
cy.url()
.should('contain', '/projects/1/kanban')
+1 -1
View File
@@ -90,7 +90,7 @@ export const getProjectView = (projectId: IProject['id']) => {
}
const projectViewSettings = JSON.parse(projectViewSettingsString) as ProjectViewSettings
if (router.hasRoute(projectViewSettings[projectId])) {
if (!router.hasRoute(projectViewSettings[projectId])) {
throw new Error()
}
return projectViewSettings[projectId]