fix: make sure redirects to a saved view work as intended
continuous-integration/drone/pr Build was killed Details

This commit is contained in:
kolaente 2023-03-14 14:09:30 +01:00
parent b958c5f197
commit 6507066f0f
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
2 changed files with 3 additions and 1 deletions

View File

@ -35,9 +35,11 @@ describe('Projects', () => {
}) })
it('Should redirect to a specific project view after visited', () => { 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.visit('/projects/1/kanban')
cy.url() cy.url()
.should('contain', '/projects/1/kanban') .should('contain', '/projects/1/kanban')
cy.wait('@loadBuckets')
cy.visit('/projects/1') cy.visit('/projects/1')
cy.url() cy.url()
.should('contain', '/projects/1/kanban') .should('contain', '/projects/1/kanban')

View File

@ -90,7 +90,7 @@ export const getProjectView = (projectId: IProject['id']) => {
} }
const projectViewSettings = JSON.parse(projectViewSettingsString) as ProjectViewSettings const projectViewSettings = JSON.parse(projectViewSettingsString) as ProjectViewSettings
if (router.hasRoute(projectViewSettings[projectId])) { if (!router.hasRoute(projectViewSettings[projectId])) {
throw new Error() throw new Error()
} }
return projectViewSettings[projectId] return projectViewSettings[projectId]