File tree Expand file tree Collapse file tree 2 files changed +5
-9
lines changed Expand file tree Collapse file tree 2 files changed +5
-9
lines changed Original file line number Diff line number Diff line change 11import { ComponentFixture , TestBed } from '@angular/core/testing' ;
2+ import { provideZonelessChangeDetection } from '@angular/core' ;
3+ import { RouterTestingModule } from '@angular/router/testing' ;
24
35import { AppComponent } from './app.component' ;
46
@@ -8,7 +10,8 @@ describe('AppComponent', () => {
810
911 beforeEach ( async ( ) => {
1012 await TestBed . configureTestingModule ( {
11- imports : [ AppComponent ]
13+ imports : [ AppComponent , RouterTestingModule ] ,
14+ providers : [ provideZonelessChangeDetection ( ) ]
1215 } )
1316 . compileComponents ( ) ;
1417
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ describe('App', () => {
66 beforeEach ( async ( ) => {
77 await TestBed . configureTestingModule ( {
88 imports : [ App ] ,
9- providers : [ provideZonelessChangeDetection ( ) ]
9+ providers : [ provideZonelessChangeDetection ( ) ] ,
1010 } ) . compileComponents ( ) ;
1111 } ) ;
1212
@@ -15,11 +15,4 @@ describe('App', () => {
1515 const app = fixture . componentInstance ;
1616 expect ( app ) . toBeTruthy ( ) ;
1717 } ) ;
18-
19- it ( 'should render title' , ( ) => {
20- const fixture = TestBed . createComponent ( App ) ;
21- fixture . detectChanges ( ) ;
22- const compiled = fixture . nativeElement as HTMLElement ;
23- expect ( compiled . querySelector ( 'h1' ) ?. textContent ) . toContain ( 'Hello, admin' ) ;
24- } ) ;
2518} ) ;
You can’t perform that action at this time.
0 commit comments