Testing
Unit test a component with TestBed. Configure declarations/imports, create fixture, detectChanges, query the native element. Expect ‘Fail’ text when marks are 20.
HttpClientTestingModule (or provideHttpClientTesting) mocks HTTP. Don’t hit a real server in unit tests. Trap: only writing e2e and skipping TestBed.
Exam tip
TestBed fixture + one assertion on Fail.