diff --git a/cypress/e2e/addContent/addYoutube.cy.ts b/cypress/e2e/addContent/addYoutube.cy.ts index 799f10913..288569bbf 100644 --- a/cypress/e2e/addContent/addYoutube.cy.ts +++ b/cypress/e2e/addContent/addYoutube.cy.ts @@ -15,7 +15,18 @@ describe('Add Youtube Content', () => { cy.get('[data-testid="skip-location-btn"').click() cy.get('[data-testid="check-icon"]').click() - cy.wait('@addYoutube') + cy.wait('@addYoutube').then((interception) => { + //check we get a 402 response code, when trying to add content for the first time + expect(interception.response.statusCode).to.eq(402) + }) + + cy.intercept({ + method: 'POST', + url: 'http://localhost:8444/api/add_node*', + }).as('addYoutube2') + + cy.wait('@addYoutube2') + cy.get('.Toastify__toast-body').should('have.text', 'Content Added') cy.get('#addContent').should('not.exist') })