diff --git a/cypress/e2e/Incidents/incidents.spec.js b/cypress/e2e/Incidents/incidents.spec.js index 3bcc3ec2..cb831ba5 100644 --- a/cypress/e2e/Incidents/incidents.spec.js +++ b/cypress/e2e/Incidents/incidents.spec.js @@ -49,7 +49,7 @@ describe('Manage Open Incidents', { failFast: { enabled: true } }, () => { it('Select all incidents', () => { selectAllIncidents(); - cy.get('.selected-incidents-badge').then(($el) => { + cy.get('.selected-incidents-badge').should(($el) => { const text = $el.text(); const incidentNumbers = text.split(' ')[0].split('/'); expect(incidentNumbers[0]).to.equal(incidentNumbers[1]); @@ -59,7 +59,7 @@ describe('Manage Open Incidents', { failFast: { enabled: true } }, () => { // Shift-select multiple incidents selectIncident(0); selectIncident(4, true); - cy.get('.selected-incidents-badge').then(($el) => { + cy.get('.selected-incidents-badge').should(($el) => { const text = $el.text(); const incidentNumbers = text.split(' ')[0].split('/'); expect(incidentNumbers[0]).to.equal('5'); diff --git a/cypress/support/util/common.js b/cypress/support/util/common.js index 0846b4c3..af58b0d1 100644 --- a/cypress/support/util/common.js +++ b/cypress/support/util/common.js @@ -49,7 +49,7 @@ export const selectAllIncidents = () => { }; export const checkNoIncidentsSelected = () => { - cy.get('.selected-incidents-badge').then(($el) => { + cy.get('.selected-incidents-badge').should(($el) => { const text = $el.text(); const incidentNumbers = text.split(' ')[0].split('/'); expect(incidentNumbers[0]).to.equal('0');