1 00:00:01,280 --> 00:00:04,950 We've got the tests around the listener passing but we do have some other failures. 2 00:00:04,970 --> 00:00:08,660 We're going to fix up all those failures they're related to a change we made to our ticket model just 3 00:00:08,660 --> 00:00:09,520 a little bit ago. 4 00:00:09,560 --> 00:00:14,210 But first I want to wrap up the tests around the ticket created listener so for right now I'm going 5 00:00:14,210 --> 00:00:22,040 to filter the tests we run by pressing W and then P and I'll enter in the name of the ticket created 6 00:00:22,100 --> 00:00:22,780 listener files. 7 00:00:22,790 --> 00:00:28,970 So just ticket created listener should be enough not going to run just tests out that file again just 8 00:00:28,970 --> 00:00:35,170 to hide those other kind of annoying failures get back inside my editor now going to wrap up the second 9 00:00:35,170 --> 00:00:39,670 test right here so the only goal of this test is to make sure that we actually call the act function 10 00:00:40,000 --> 00:00:44,710 after we have somehow process the events we're gonna go through a very similar series of steps we first 11 00:00:44,710 --> 00:00:50,620 called setup then call on message and then write out some assertion so let's get to it at the very top 12 00:00:50,620 --> 00:00:59,490 of the test we will get data listener and message from a set setup 13 00:01:02,530 --> 00:01:06,880 well then call the on message function and we'll pass on the data object and the message objects so 14 00:01:06,910 --> 00:01:16,530 await listener on message and pass in data and message and then finally we need to write an assertion 15 00:01:16,530 --> 00:01:21,080 to make sure that the act function on that message object was actually called it's a pretty straightforward 16 00:01:21,090 --> 00:01:33,130 to do that we'll do expect MSU dot EQ to have been felt let's say that check our tests looks good as 17 00:01:33,130 --> 00:01:39,940 usual make it fail we'll say not to have been called very quickly yep definitely fails definitely gets 18 00:01:39,940 --> 00:01:47,400 called one time by will remove that dot not and we are good to go Oh well I would say that looks pretty 19 00:01:47,400 --> 00:01:48,510 reasonable. 20 00:01:48,520 --> 00:01:49,620 Let's take a quick pause right here. 21 00:01:49,620 --> 00:01:53,370 We can come back the next video and we're going to fix up some of those other tests we have inside of 22 00:01:53,400 --> 00:01:54,420 our order service. 23 00:01:54,420 --> 00:01:58,650 I know it's very off topic from all this listener stuff but it's something that we broke just a little 24 00:01:58,650 --> 00:02:02,490 bit ago when we were breaking on these listeners and we just never quite saw those tests were failing 25 00:02:02,520 --> 00:02:08,010 until right now the little divergence in the next video and then come back to testing our ticket updated 26 00:02:08,070 --> 00:02:08,880 listener as well.