ashitvora's avatar

What's the best way to test a feature not dealing with calling third party API?

I am working on an app were two people receive an email with 2 links.

  1. Accept
  2. Reject

When both the parties click on ACCEPT link, I want to send an email.

What's the best way to test this using an automated test to make sure email is only sent out when both the parties click ACCEPT.

The default state is PENDING and once the user clicks on any one of the links, the state is changed to ACCEPTED or REJECTED.

0 likes
4 replies
bobbybouwmann's avatar

Well, when they click the button you probably post to some API or some form right? You can mimic this request right? So you can fake the click on the button of the email and do that twice in your test and then you can use the mail facade to check if the new email was send.

Let me know if you understand this!

ashitvora's avatar

Yes, I can mimic the click event but not sure about... use the mail facade to check if the new email was sent.

Any link you can point me to read more on this?

ashitvora's avatar

I am firing an event when the link is clicked if the first link was already clicked. Is there a way to check if event was fired using automated test?

Please or to participate in this conversation.