Skip to content
This repository has been archived by the owner on Mar 31, 2021. It is now read-only.

Commit

Permalink
#145 use once instead of on for event handler happening only once
Browse files Browse the repository at this point in the history
#145 Purchase order from sales order
  • Loading branch information
cristinastefan90 committed Jul 17, 2019
1 parent 559364e commit bf246bd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cypress/support/commands/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ Cypress.Commands.add('editAddress', (fieldName, addressFunction) => {

Cypress.emit('emit:addressPatchResolved', requestId);
});

cy.on('emit:addressPatchResolved', requestId => {
/**for each POST address request above, the event handler code needs to happen only once */
cy.once('emit:addressPatchResolved', requestId => {
cy.route('POST', `/rest/api/address/${requestId}/complete`).as('completeAddress');

const outerPatchUrl = `/rest/api/address/${requestId}`;
Expand Down

0 comments on commit bf246bd

Please sign in to comment.