From fe39c0d876a1f56e6a9ae8306a2fc3ba4426eabc Mon Sep 17 00:00:00 2001 From: aliraza556 Date: Sat, 2 Nov 2024 13:37:39 +0500 Subject: [PATCH] fix(test): cypress --- cypress/e2e/addContent/addTweet.cy.ts | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/cypress/e2e/addContent/addTweet.cy.ts b/cypress/e2e/addContent/addTweet.cy.ts index aedb9d2cc..80e15db58 100644 --- a/cypress/e2e/addContent/addTweet.cy.ts +++ b/cypress/e2e/addContent/addTweet.cy.ts @@ -12,18 +12,25 @@ describe('Add Tweet Content', () => { cy.get('#addContent').should('exist') cy.get('[id="cy-youtube-channel-id"]').type('https://twitter.com/ijbguy/status/1771096005162729663') cy.get('[data-testid="add-content-btn"]').click() + cy.get('[data-testid="skip-location-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.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) + // }) - // Wait for the UI to update and toast to appear - cy.wait(5000) - cy.get('.Toastify__toast-body', { timeout: 15000 }).should('have.text', 'Content Added') + // 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') + + cy.get('.Toastify__toast-body').should('have.text', 'Content Added') - // Verify the modal is closed cy.get('#addContent').should('not.exist') }) })