From 7abf2972577e5922ea92ccf31b6d898b3eccfecd Mon Sep 17 00:00:00 2001 From: Oliver Eyton-Williams Date: Thu, 4 Apr 2024 14:32:06 +0100 Subject: [PATCH] test: check for navigation, not text (#54298) --- cypress/e2e/default/learn/challenges/projects.ts | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/cypress/e2e/default/learn/challenges/projects.ts b/cypress/e2e/default/learn/challenges/projects.ts index f5774418e95..08733d24367 100644 --- a/cypress/e2e/default/learn/challenges/projects.ts +++ b/cypress/e2e/default/learn/challenges/projects.ts @@ -112,11 +112,14 @@ describe('project submission', () => { return challenges.find(({ title }) => title === projectTitle); }) as Challenge[]; - // We need to wait for everything to finish loading and hydrating, so we - // use this text as a proxy for that. - const textInNextPage = projectTitles.slice(1); - // The following text exists on the donation modal - textInNextPage.push('Nicely done'); + const expectedPaths = projectsInOrder + .slice(1) + .map(({ block, superBlock, dashedName }) => { + return `/learn/${superBlock}/${block}/${dashedName}`; + }); + expectedPaths.push( + `/learn/javascript-algorithms-and-data-structures/` + ); projectsInOrder.forEach( ({ block, superBlock, dashedName, solutions }, i) => { @@ -139,7 +142,7 @@ describe('project submission', () => { cy.contains('Submit and go to next challenge', { timeout: 16000 }).click(); - cy.contains(textInNextPage[i]); + cy.url().should('include', expectedPaths[i]); }); }); }