From 00c54c00e6576debe78fea9e7e01c8d21fe6eab2 Mon Sep 17 00:00:00 2001 From: heikkkk <henrik.teksle.sandok@hotmail.no> Date: Wed, 1 May 2024 22:02:39 +0200 Subject: [PATCH] test: add e2e test for redirecting to user page --- cypress/e2e/LeaderboardView.cy.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/cypress/e2e/LeaderboardView.cy.ts b/cypress/e2e/LeaderboardView.cy.ts index fcf8b66..24edb3a 100644 --- a/cypress/e2e/LeaderboardView.cy.ts +++ b/cypress/e2e/LeaderboardView.cy.ts @@ -42,4 +42,15 @@ describe("Leaderboard Test", () => { .should('have.length', 3); }) + it('redirects to profile-page when clicking user', () => { + cy.get('[data-cy="total-points-board"]') + .find('[data-cy="top-leaderboard-tablerow"]') + .first() + .within(() => { + cy.get('td:nth-child(2)').click(); + }) + cy.wait(1000); + cy.url().should('include', '/profile/15'); + }) + }) \ No newline at end of file -- GitLab