xrm-mock icon indicating copy to clipboard operation
xrm-mock copied to clipboard

Testing onChange event with async code

Open lalberto8085 opened this issue 3 months ago • 2 comments

Hello,

I'm starting to use this for unit testing my front end code, so I need some help moving forward.

I have a Date attribute that will make an Xrm.WebApi.retrieveMultipleRecords call on the onChange handler. I saw the code sample on how to use sinon to mock the call, but it is sill async and I can't await it since fireOnChange is not "awaitable" (AFAIK).

Please point me in the right direction if there's any techniques or design patterns I'm missing. Thanks in advace

lalberto8085 avatar Apr 02 '24 03:04 lalberto8085