mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
test: check for navigation, not text (#54298)
This commit is contained in:
committed by
GitHub
parent
dd74e8a72d
commit
7abf297257
@@ -112,11 +112,14 @@ describe('project submission', () => {
|
|||||||
return challenges.find(({ title }) => title === projectTitle);
|
return challenges.find(({ title }) => title === projectTitle);
|
||||||
}) as Challenge[];
|
}) as Challenge[];
|
||||||
|
|
||||||
// We need to wait for everything to finish loading and hydrating, so we
|
const expectedPaths = projectsInOrder
|
||||||
// use this text as a proxy for that.
|
.slice(1)
|
||||||
const textInNextPage = projectTitles.slice(1);
|
.map(({ block, superBlock, dashedName }) => {
|
||||||
// The following text exists on the donation modal
|
return `/learn/${superBlock}/${block}/${dashedName}`;
|
||||||
textInNextPage.push('Nicely done');
|
});
|
||||||
|
expectedPaths.push(
|
||||||
|
`/learn/javascript-algorithms-and-data-structures/`
|
||||||
|
);
|
||||||
|
|
||||||
projectsInOrder.forEach(
|
projectsInOrder.forEach(
|
||||||
({ block, superBlock, dashedName, solutions }, i) => {
|
({ block, superBlock, dashedName, solutions }, i) => {
|
||||||
@@ -139,7 +142,7 @@ describe('project submission', () => {
|
|||||||
cy.contains('Submit and go to next challenge', {
|
cy.contains('Submit and go to next challenge', {
|
||||||
timeout: 16000
|
timeout: 16000
|
||||||
}).click();
|
}).click();
|
||||||
cy.contains(textInNextPage[i]);
|
cy.url().should('include', expectedPaths[i]);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user