As the title suggests, I'd like to ask if anyone knows the solution to how to get this unit test to pass, after adding the support service to the test123 component, it won't display true anymore no matter what I do. Image sample of the code and error messages
In the future, please post code as code, not as an image.
There are a number of issues with the code as you outlined. Here are a few:
secondsToTimeFormat()
, but in the component you call this.supportService.secondsToTime()
.no provider for Router!
. In order to isolate this component, you ought to mock the service call with a spy.To show you all this actually working, I put together this Stackblitz.
See the docs for details on how to do all this.