Skip to content

Commit

Permalink
fix cypress intercept misses a call that just happened, moved the int…
Browse files Browse the repository at this point in the history
…ercept higher in the method
  • Loading branch information
ValenberghsSven committed Nov 28, 2024
1 parent 56d45ec commit 50757ad
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cypress/support/commands/case-commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,21 +135,21 @@ function addSubcaseViaModal(subcase) {
const randomInt = Math.floor(Math.random() * Math.floor(10000));

cy.log('addSubcaseViaModal');
cy.intercept('GET', '/government-bodies**').as(`getGovernmentBodies${randomInt}`);
cy.intercept('GET', '/mandatees**').as(`getMandatees${randomInt}`);
cy.intercept('POST', '/subcases').as(`createNewSubcase${randomInt}`);
cy.intercept('POST', '/meetings/*/submit').as(`submitToMeeting${randomInt}`);
cy.intercept('POST', '/submission-activities').as(`postSubmissionActivities${randomInt}`);
cy.intercept('GET', '/mandatees**').as(`getMandatees${randomInt}`);
cy.intercept('GET', '/government-bodies**').as(`getGovernmentBodies${randomInt}`);

// after creating a case we are already on the page to add a subcase
if (!subcase.newCase) {
cy.get(cases.subcaseOverviewHeader.openAddSubcase).click();
}

cy.wait(`@getMandatees${randomInt}`, {
cy.wait(`@getGovernmentBodies${randomInt}`, {
timeout: 60000,
});
cy.wait(`@getGovernmentBodies${randomInt}`, {
cy.wait(`@getMandatees${randomInt}`, {
timeout: 60000,
});

Expand Down

0 comments on commit 50757ad

Please sign in to comment.