diff --git a/site/gatsby-site/cypress/e2e/integration/cite.cy.js b/site/gatsby-site/cypress/e2e/integration/cite.cy.js index e244d83184..c3e1f9d614 100644 --- a/site/gatsby-site/cypress/e2e/integration/cite.cy.js +++ b/site/gatsby-site/cypress/e2e/integration/cite.cy.js @@ -849,11 +849,18 @@ describe('Cite pages', () => { it('Should link similar incidents', () => { cy.login(Cypress.env('e2eUsername'), Cypress.env('e2ePassword')); + cy.conditionalIntercept( + '**/graphql', + (req) => req.body.operationName == 'UpdateIncident', + 'updateIncident', + updateIncident50 + ); + cy.conditionalIntercept( '**/graphql', (req) => req.body.operationName == 'UpdateIncidents' && - req.body.variables.set.editor_similar_incidents == 10, + req.body.variables.set.editor_similar_incidents == 50, 'updateSimilarIncidents', { data: { @@ -869,7 +876,7 @@ describe('Cite pages', () => { '**/graphql', (req) => req.body.operationName == 'UpdateIncidents' && - req.body.variables.set.editor_dissimilar_incidents == 10, + req.body.variables.set.editor_dissimilar_incidents == 50, 'updateDissimilarIncidents', { data: { @@ -881,7 +888,7 @@ describe('Cite pages', () => { } ); - cy.visit('/incidents/edit/?incident_id=10'); + cy.visit('/incidents/edit/?incident_id=50'); cy.waitForStableDOM(); @@ -906,17 +913,19 @@ describe('Cite pages', () => { cy.get('button[type="submit"]').click(); + cy.wait('@updateIncident', { timeout: 8000 }); + cy.wait('@updateSimilarIncidents', { timeout: 30000 }).then((xhr) => { expect(xhr.request.body.variables.query).deep.eq({ incident_id_in: [123] }); expect(xhr.request.body.variables.set).to.deep.eq({ - editor_similar_incidents: [10], + editor_similar_incidents: [50], }); }); cy.wait('@updateDissimilarIncidents', { timeout: 30000 }).then((xhr) => { expect(xhr.request.body.variables.query).deep.eq({ incident_id_in: [456] }); expect(xhr.request.body.variables.set).to.deep.eq({ - editor_dissimilar_incidents: [10], + editor_dissimilar_incidents: [50], }); }); });