Closed ECJ222 closed 2 years ago
Hi,
could you share a small reproduction repo/codesandbox or similar with a full component? This should definitely work but it is hard to tell without actually seeing the whole data flow.
btw, could you give waitFor
a quick go? Something like: await waitFor(() => expect(emitted()['captured-image']).toHaveLength(1))
Yes, @afontcu, that worked looks like all I needed to do was wait for the promise to be resolved before the events could be emitted.
Thank you!
When trying to listen to events emitted inside a component from an asynchronous function, for some reason the
emitted()
query doesn't see those kind of events, Check the example below, I also added a screenshot.Relevant code or config (if any)
Test:
Component:
Expected:
Returns