From cd160033ba4e2971435e5918d2aa4ff1f28db95e Mon Sep 17 00:00:00 2001 From: MuhammadUmer44 Date: Sat, 21 Sep 2024 17:49:43 +0500 Subject: [PATCH] fix(cypress): memory issue --- cypress/e2e/addContent/addTweet.cy.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/cypress/e2e/addContent/addTweet.cy.ts b/cypress/e2e/addContent/addTweet.cy.ts index db24f684d..dc0c5222f 100644 --- a/cypress/e2e/addContent/addTweet.cy.ts +++ b/cypress/e2e/addContent/addTweet.cy.ts @@ -12,11 +12,11 @@ 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="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 + // Check we get a 402 response code when trying to add content for the first time expect(interception.response.statusCode).to.eq(402) }) @@ -25,7 +25,12 @@ describe('Add Tweet Content', () => { url: 'http://localhost:8444/api/add_node*', }).as('addTweet2') - cy.wait('@addTweet2') // This is because add source is currently skipped, + cy.get('[data-testid="add-content-btn"]').click() + + cy.wait('@addTweet2').then((interception) => { + // Check we get a successful response code + expect(interception.response.statusCode).to.eq(200) + }) cy.get('.Toastify__toast-body').should('have.text', 'Content Added')