1 00:00:00,090 --> 00:00:04,270 In this lecture, we are going to address a hidden issue with our test. 2 00:00:04,290 --> 00:00:08,520 It may not seem like it, but there is an error being thrown by our test. 3 00:00:08,520 --> 00:00:10,770 Karma is not picking up on it. 4 00:00:10,800 --> 00:00:15,840 The error can be viewed by opening the developer tools in the console panel. 5 00:00:15,870 --> 00:00:18,540 A few errors will be thrown by our components. 6 00:00:18,570 --> 00:00:23,130 According to the errors, the component relies on routing to be functional. 7 00:00:23,160 --> 00:00:26,080 We're using router directives for our links. 8 00:00:26,100 --> 00:00:29,790 Without the routing module, our component will throw errors. 9 00:00:29,820 --> 00:00:31,610 Fixing this is simple. 10 00:00:31,620 --> 00:00:36,060 The Angular team has a variation of the routing module for testing. 11 00:00:36,090 --> 00:00:40,770 We can import this module for supporting basic routing features in our tests. 12 00:00:40,800 --> 00:00:45,480 It's simpler than using the regular routing module in your editor. 13 00:00:45,510 --> 00:00:48,000 Open the navigation test file. 14 00:00:50,140 --> 00:00:58,990 At the top of the file import the router testing module object from the angular slash router slash testing 15 00:00:58,990 --> 00:00:59,830 package. 16 00:01:04,099 --> 00:01:08,420 Next scroll to the testing module's configuration object. 17 00:01:08,420 --> 00:01:11,120 In this object, add the imports array. 18 00:01:13,360 --> 00:01:16,510 Lastly, add the router testing module. 19 00:01:16,510 --> 00:01:18,010 Object to the array. 20 00:01:20,320 --> 00:01:23,860 After making those adjustments, the error should go away. 21 00:01:23,890 --> 00:01:25,600 Head on over to the browser. 22 00:01:25,630 --> 00:01:27,750 The console should have been cleared. 23 00:01:27,760 --> 00:01:31,690 If not, you can refresh the page to view a fresh console. 24 00:01:31,720 --> 00:01:36,880 This time around, the errors related to the routing features have disappeared. 25 00:01:37,000 --> 00:01:43,790 If your component relies on angular routing package, you can use this module over the regular module. 26 00:01:43,810 --> 00:01:49,480 It requires less configuration without sacrificing the original features of the package. 27 00:01:49,510 --> 00:01:51,670 Our component is finally working. 28 00:01:51,670 --> 00:01:56,440 We can start writing a test for testing the logout link in the next lecture. 29 00:01:56,440 --> 00:01:58,690 Let's begin writing another test.