Fix: Resolve 13 pre-existing UI test failures across Login, Upload, and Detail components
- LoginComponent: provide ActivatedRoute stub (component reads returnUrl query param) - UploadComponent: add cdr.markForCheck() to handleUploadError so OnPush view updates when the method is called directly; fix success test to check showSuccess not toastMessage - DetailComponent: drive not-found-card and tag-error tests through component methods that call markForCheck() rather than directly mutating state on OnPush components Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { TestBed, fakeAsync, tick } from '@angular/core/testing';
|
||||
import { ReactiveFormsModule } from '@angular/forms';
|
||||
import { Router } from '@angular/router';
|
||||
import { ActivatedRoute, Router, convertToParamMap } from '@angular/router';
|
||||
import { HttpErrorResponse } from '@angular/common/http';
|
||||
import { of, throwError } from 'rxjs';
|
||||
import { LoginComponent } from './login.component';
|
||||
@@ -20,6 +20,7 @@ describe('LoginComponent', () => {
|
||||
providers: [
|
||||
{ provide: AuthService, useValue: authService },
|
||||
{ provide: Router, useValue: router },
|
||||
{ provide: ActivatedRoute, useValue: { snapshot: { queryParamMap: convertToParamMap({}) } } },
|
||||
],
|
||||
}).compileComponents();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user