1 00:00:00,699 --> 00:00:01,859 Speaker: In the last section, 2 00:00:01,859 --> 00:00:04,050 we started writing out some comments to guide ourselves 3 00:00:04,050 --> 00:00:06,390 through this integration test we're working on. 4 00:00:06,390 --> 00:00:07,650 In this section, we're gonna continue 5 00:00:07,650 --> 00:00:11,790 by putting together some implementation for this first step. 6 00:00:11,790 --> 00:00:14,756 So we want to try to render out our entire application. 7 00:00:14,756 --> 00:00:17,018 We can do that by rendering an instance 8 00:00:17,018 --> 00:00:20,250 of our root component and passing at the app. 9 00:00:20,250 --> 00:00:22,380 The app component contains all the other components 10 00:00:22,380 --> 00:00:23,700 inside of our application. 11 00:00:23,700 --> 00:00:25,710 So by rendering these two things together, 12 00:00:25,710 --> 00:00:28,773 it's going to essentially display our entire application. 13 00:00:29,697 --> 00:00:31,115 So underneath that first comment, 14 00:00:31,115 --> 00:00:35,870 we'll write out 'const wrapped' is 'mount with root', 15 00:00:39,750 --> 00:00:42,153 and we'll pass that thing our app like so. 16 00:00:43,097 --> 00:00:45,552 You'll notice that we're not passing any initial state 17 00:00:45,552 --> 00:00:47,310 to the root component. 18 00:00:47,310 --> 00:00:49,200 That's because there is no initial state 19 00:00:49,200 --> 00:00:51,510 that we want to provide to our Redux store. 20 00:00:51,510 --> 00:00:52,920 The entire purpose of this test 21 00:00:52,920 --> 00:00:55,740 is to confirm that our application can reach out 22 00:00:55,740 --> 00:01:00,218 to that JSON API and fetch a list of comments by itself. 23 00:01:00,218 --> 00:01:01,446 So I'm gonna save this file 24 00:01:01,446 --> 00:01:03,210 and I'm gonna flip back over to my terminal 25 00:01:03,210 --> 00:01:05,920 and just make sure that all my tests are still passing. 26 00:01:05,920 --> 00:01:07,410 So if I flip back over 27 00:01:07,410 --> 00:01:10,110 you might notice that you have one failing test. 28 00:01:10,110 --> 00:01:11,613 So let's see what it is. 29 00:01:13,200 --> 00:01:14,100 So it looks like the failure 30 00:01:14,100 --> 00:01:16,454 is coming from our comment box component. 31 00:01:16,454 --> 00:01:18,180 You'll recall that inside there 32 00:01:18,180 --> 00:01:19,380 we put together a test 33 00:01:19,380 --> 00:01:21,773 to make sure that we have exactly one text area 34 00:01:21,773 --> 00:01:23,730 and one button. 35 00:01:23,730 --> 00:01:24,570 But, just a moment ago 36 00:01:24,570 --> 00:01:28,530 we added a second button tag to the comment box. 37 00:01:28,530 --> 00:01:31,650 That button has purpose of fetching our list of comments. 38 00:01:31,650 --> 00:01:33,600 So, that's why we're seeing the failure here. 39 00:01:33,600 --> 00:01:35,541 We expected to see only one button tag, 40 00:01:35,541 --> 00:01:37,920 but in fact there were two. 41 00:01:37,920 --> 00:01:39,970 So let's very quickly go and fix that up. 42 00:01:41,550 --> 00:01:45,573 I'm gonna open up my test, 'commentbox.test.js' file, 43 00:01:46,770 --> 00:01:50,153 and I'll find the hazard text area and a button test. 44 00:01:50,153 --> 00:01:52,376 So now, rather than finding one button, 45 00:01:52,376 --> 00:01:54,753 I'm going to expect to find two. 46 00:01:55,650 --> 00:01:56,910 And then I will also update 47 00:01:56,910 --> 00:01:58,920 the description of this file as well. 48 00:01:58,920 --> 00:02:02,823 So, we have a text area and two buttons. 49 00:02:04,542 --> 00:02:06,690 Okay, so that should probably be it. 50 00:02:06,690 --> 00:02:08,070 Let's flip back over to our terminal 51 00:02:08,070 --> 00:02:10,669 and just make sure that our tests are still passing. 52 00:02:11,580 --> 00:02:12,480 Alright, so back over here 53 00:02:12,480 --> 00:02:14,630 I'll wait just a second for the test to go. 54 00:02:16,950 --> 00:02:17,783 And you can see 55 00:02:17,783 --> 00:02:21,420 that our comment box test file has passed successfully. 56 00:02:21,420 --> 00:02:22,950 Alright, let's take a quick pause right here. 57 00:02:22,950 --> 00:02:24,390 When we come back to the next section, 58 00:02:24,390 --> 00:02:25,458 we're going to continue working 59 00:02:25,458 --> 00:02:27,570 on our integration test over here. 60 00:02:27,570 --> 00:02:30,070 So, quick break and I'll see you in just a minute.