Skip to content

Commit

Permalink
Add e2e tests that test if route is preserved
Browse files Browse the repository at this point in the history
  • Loading branch information
RandomTannenbaum committed Nov 4, 2024
1 parent aacd11e commit dc01988
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion frontend/cypress/e2e/teammanagement.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down

0 comments on commit dc01988

Please sign in to comment.