From dc01988d906a60b5bce5762ac219d2258748513b Mon Sep 17 00:00:00 2001 From: Jannik Pulfer Date: Mon, 4 Nov 2024 12:57:51 +0100 Subject: [PATCH] Add e2e tests that test if route is preserved --- frontend/cypress/e2e/teammanagement.cy.ts | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/frontend/cypress/e2e/teammanagement.cy.ts b/frontend/cypress/e2e/teammanagement.cy.ts index ee393ddbea..1b5c1379f4 100644 --- a/frontend/cypress/e2e/teammanagement.cy.ts +++ b/frontend/cypress/e2e/teammanagement.cy.ts @@ -8,16 +8,35 @@ describe('Team management tests', () => { describe('Routing to overview', () => { beforeEach(() => { cy.loginAsUser(users.gl); - cy.getByTestId('team-management').click(); }); 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', '5'); + cy.url().should('include', '4'); + } }); describe('As GL', () => {