lundi 28 octobre 2019

How to test a stubbed function called with certain shape of object as argument in Cypress?

How can I test that a stubbed function is called with an object in a certain shape as the argument?

For example, I was trying to do something like

cy.get('@submitStub').should('have.been.calledWithMatch', {
  dateRange: {
    startDate: `The actual value here doesn't matter`,
    endDate: '',
  }
});

Of course the above code doesn't work as expected. Can anyone help? Thank you!

Aucun commentaire:

Enregistrer un commentaire