We've got the tests around the listener passing but we do have some other failures.
We're going to fix up all those failures they're related to a change we made to our ticket model just
a little bit ago.
But first I want to wrap up the tests around the ticket created listener so for right now I'm going
to filter the tests we run by pressing W and then P and I'll enter in the name of the ticket created
listener files.
So just ticket created listener should be enough not going to run just tests out that file again just
to hide those other kind of annoying failures get back inside my editor now going to wrap up the second
test right here so the only goal of this test is to make sure that we actually call the act function
after we have somehow process the events we're gonna go through a very similar series of steps we first
called setup then call on message and then write out some assertion so let's get to it at the very top
of the test we will get data listener and message from a set setup
well then call the on message function and we'll pass on the data object and the message objects so
await listener on message and pass in data and message and then finally we need to write an assertion
to make sure that the act function on that message object was actually called it's a pretty straightforward
to do that we'll do expect MSU dot EQ to have been felt let's say that check our tests looks good as
usual make it fail we'll say not to have been called very quickly yep definitely fails definitely gets
called one time by will remove that dot not and we are good to go Oh well I would say that looks pretty
reasonable.
Let's take a quick pause right here.
We can come back the next video and we're going to fix up some of those other tests we have inside of
our order service.
I know it's very off topic from all this listener stuff but it's something that we broke just a little
bit ago when we were breaking on these listeners and we just never quite saw those tests were failing
until right now the little divergence in the next video and then come back to testing our ticket updated
listener as well.