Skip to content

Commit

Permalink
Merge pull request #4 from newfold-labs/update/cypress-test
Browse files Browse the repository at this point in the history
Quick cypress tests update to reflect recent changes
  • Loading branch information
wpalani authored Nov 29, 2023
2 parents 3cc97a3 + 89a0765 commit 5668c20
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tests/cypress/integration/deactivation-survey.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ describe('Plugin Deactivation Survey', () => {
method: 'GET',
url: /newfold-notifications/,
}, { body: {} });
cy.intercept({
method: 'POST',
url: /newfold-data(\/|%2F)v1(\/|%2F)events/,
}).as('surveyEvent');

// reopen modal
cy.get('.deactivate a[id*="' + Cypress.env('pluginId') + '"]').click();
Expand All @@ -53,7 +57,9 @@ describe('Plugin Deactivation Survey', () => {
cy.get('button[nfd-deactivation-survey-skip]')
.should('be.visible');
cy.get('button[nfd-deactivation-survey-skip]').click();
cy.wait(500);
cy.wait('@surveyEvent')
// .its('request.body.action').should('eq', 'deactivation_survey_freeform')
.its('request.body.data.survey_input').should('eq', 'No input');
// verify modal closed
cy.get('.nfd-deactivation-survey__content').should('not.exist');
// verify plugin is deactivated
Expand All @@ -64,7 +70,6 @@ describe('Plugin Deactivation Survey', () => {
cy.wait(500);
});


it('Survey successfully deactivates plugin', () => {
// ignore notifications errors if there are any
cy.intercept({
Expand Down

0 comments on commit 5668c20

Please sign in to comment.