Skip to content

Commit

Permalink
fix: also check for 402 when adding youtube
Browse files Browse the repository at this point in the history
  • Loading branch information
tobi-bams committed Sep 23, 2024
1 parent 9dbf13f commit dacc574
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion cypress/e2e/addContent/addYoutube.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
})
Expand Down

0 comments on commit dacc574

Please sign in to comment.