From 165d4f47f945b3b82f231ae06609a91294d7f266 Mon Sep 17 00:00:00 2001 From: nevio18324 <141240169+nevio18324@users.noreply.github.com> Date: Wed, 6 Nov 2024 13:08:40 +0100 Subject: [PATCH] Bug/1013 routing to overview (#1084) * Add permanent teamverwaltung button and make logo route to / * Make router links leading to homepage preserve query params * Change tag around logo from span to a * Add e2e tests that test if route is preserved --------- Co-authored-by: Jannik Pulfer Co-authored-by: GitHub Actions --- frontend/cypress/e2e/tab.cy.ts | 1 + frontend/cypress/e2e/teammanagement.cy.ts | 34 +++++++++++++++++++ .../application-top-bar.component.html | 20 ++++++----- .../application-top-bar.component.ts | 12 ------- .../team-management-banner.component.html | 4 ++- 5 files changed, 49 insertions(+), 22 deletions(-) diff --git a/frontend/cypress/e2e/tab.cy.ts b/frontend/cypress/e2e/tab.cy.ts index ee8143f4eb..7909c48142 100644 --- a/frontend/cypress/e2e/tab.cy.ts +++ b/frontend/cypress/e2e/tab.cy.ts @@ -124,6 +124,7 @@ describe('Tab workflow tests', () => { cy.loginAsUser(users.gl); onlyOn('chrome'); cy.tabForward(); + cy.tabForward(); }); // Header from here diff --git a/frontend/cypress/e2e/teammanagement.cy.ts b/frontend/cypress/e2e/teammanagement.cy.ts index 6edf0db28e..6f595384cd 100644 --- a/frontend/cypress/e2e/teammanagement.cy.ts +++ b/frontend/cypress/e2e/teammanagement.cy.ts @@ -5,6 +5,40 @@ describe('Team management tests', () => { const teamName = uniqueSuffix('New Team'); const nameEsha = users.bl.name; + describe('Routing to overview', () => { + beforeEach(() => { + cy.loginAsUser(users.gl); + }); + it('should navigate to overview when clicking logo', () => { + cy.getByTestId('team-management').click(); + cy.getByTestId('logo').click(); + cy.url().should('not.include', 'team-management'); + }); + it('should navigate to overview when pressing back to overview', () => { + cy.getByTestId('team-management').click(); + cy.getByTestId('routerLink-to-overview').click(); + cy.url().should('not.include', 'team-management'); + }); + it('should preserve team filter', () => { + cy.get('mat-chip:visible:contains("/BBT")').click(); + cy.get('mat-chip:visible:contains("Puzzle ITC")').click(); + checkTeamsSelected(); + cy.getByTestId('team-management').click(); + checkTeamsSelected(); + cy.getByTestId('routerLink-to-overview').click(); + checkTeamsSelected(); + cy.getByTestId('team-management').click(); + cy.getByTestId('logo').click(); + checkTeamsSelected(); + }); + + function checkTeamsSelected() { + cy.url().should('include', 'teams='); + cy.url().should('include', '6'); + cy.url().should('include', '4'); + } + }); + describe('As GL', () => { before(() => { // login as bl to ensure this user exists in database diff --git a/frontend/src/app/components/application-top-bar/application-top-bar.component.html b/frontend/src/app/components/application-top-bar/application-top-bar.component.html index a22bd57d7b..3b66f02ff5 100644 --- a/frontend/src/app/components/application-top-bar/application-top-bar.component.html +++ b/frontend/src/app/components/application-top-bar/application-top-bar.component.html @@ -1,24 +1,26 @@
- - okr-logo - + + okr-logo +
- -