From dacc5747891499b9bf5121fd4671581c6fd63164 Mon Sep 17 00:00:00 2001 From: Oluwatobi Bamidele Date: Mon, 23 Sep 2024 19:43:19 +0100 Subject: [PATCH] fix: also check for 402 when adding youtube --- cypress/e2e/addContent/addYoutube.cy.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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') })