Forms, guards, HTTP, router and accessibility tests
Learn Forms, guards, HTTP, router and accessibility tests (Module 20 · Angular Testing, Angular) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.
Testing the building blocks of real apps • Testing forms : set a control value, check valid/invalid and the error message shown. • Testing validators : a validator is just a function; call it with a FormControl . • Testing HTTP services : never hit the network; use provideHttpClientTesting() and HttpTestingController to intercept requests and answer them with fake data, like a mock server.