Lab 12: Testing
Objectives
Section titled “Objectives”- Make all test pass
Task 1: Fix all dependecies:
Section titled “Task 1: Fix all dependecies:”- For all components, you need in the test to import all elements that usually are imported in the
app.module.ts. - Some exceptions:
- Components or dependences using
RouterModule, importRouterTestingModuleinstead - Components or dependences using
HttpModule, importeHttpTestingModuleinstead
- Components or dependences using
Task 2: Simple test.
Section titled “Task 2: Simple test.”- In
album.component.spec.ts. we want to test thatartist.titleandalbum.titleare rendering correctly in our html. - Create a new test case and get the
h3element and check that the content match some of thealbumproperties
compiled.querySelector('h3').textContent- Use
expectwith this selector

