fix: make sure redirects to a saved view work as intended
continuous-integration/drone/pr Build was killed
Details
continuous-integration/drone/pr Build was killed
Details
This commit is contained in:
parent
b958c5f197
commit
6507066f0f
|
@ -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')
|
||||||
|
|
|
@ -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]
|
||||||
|
|
Reference in New Issue