Skip to content

Commit

Permalink
fix: check for 402 when adding content
Browse files Browse the repository at this point in the history
  • Loading branch information
tobi-bams committed Sep 23, 2024
1 parent da3f653 commit 9dbf13f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
1 change: 0 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ jobs:
run: echo "Sanitized file $SANITIZED_FILE"

- name: Upload Cypress logs
# if: failure()
if: always()
uses: actions/upload-artifact@v4
with:
Expand Down
13 changes: 12 additions & 1 deletion cypress/e2e/addContent/addWebpage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,18 @@ describe('Add Webpage Content', () => {
cy.get('[data-testid="skip-location-btn"').click()
cy.get('[data-testid="check-icon"]').click()

cy.wait('@addWebpage')
cy.wait('@addWebpage').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('addWebpage2')

cy.wait('@addWebpage2')

cy.get('.Toastify__toast-body').should('have.text', 'Content Added')
cy.get('#addContent').should('not.exist')
})
Expand Down

0 comments on commit 9dbf13f

Please sign in to comment.