Skip to content

Commit

Permalink
fix(test): v1
Browse files Browse the repository at this point in the history
  • Loading branch information
aliraza556 committed Nov 2, 2024
1 parent 95cbbd2 commit 3c7a384
Show file tree
Hide file tree
Showing 2 changed files with 260 additions and 262 deletions.
30 changes: 12 additions & 18 deletions cypress/e2e/addContent/addTweet.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,21 @@ describe('Add Tweet Content', () => {
cy.get('[data-testid="add-content-btn"]').click()
cy.get('[data-testid="check-icon"]').click()

// cy.wait('@addTweet').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('addTweet2')

// cy.wait('@addTweet2') // This is because add source is currently skipped,

cy.wait('@addTweet').then((interception) => {
console.log('Add Tweet Response:', interception.response)

if (interception.response.statusCode !== 200) {
console.error('Error Status Code:', interception.response.statusCode)
console.error('Error Response:', interception.response.body)
}
// 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('addTweet2')

cy.wait('@addTweet2').then((intersection) => {
console.log(intersection.response)
cy.log(JSON.stringify(intersection.response))
}) // This is because add source is currently skipped,

cy.get('.Toastify__toast-body').should('have.text', 'Content Added')

cy.get('#addContent').should('not.exist')
Expand Down
Loading

0 comments on commit 3c7a384

Please sign in to comment.