File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 11import { TestBed } from '@angular/core/testing' ;
2+ import { provideRouter } from '@angular/router' ;
3+ import { provideHttpClient } from '@angular/common/http' ;
24import { App } from './app' ;
5+ import { APP_VERSION } from './app.config' ;
36
47describe ( 'App' , ( ) => {
58 beforeEach ( async ( ) => {
69 await TestBed . configureTestingModule ( {
710 imports : [ App ] ,
11+ providers : [
12+ provideRouter ( [ ] ) ,
13+ provideHttpClient ( ) ,
14+ { provide : APP_VERSION , useValue : '0.0.0-test' }
15+ ]
816 } ) . compileComponents ( ) ;
917 } ) ;
1018
@@ -14,10 +22,11 @@ describe('App', () => {
1422 expect ( app ) . toBeTruthy ( ) ;
1523 } ) ;
1624
17- it ( 'should render title ' , async ( ) => {
25+ it ( 'should render main layout ' , async ( ) => {
1826 const fixture = TestBed . createComponent ( App ) ;
1927 await fixture . whenStable ( ) ;
2028 const compiled = fixture . nativeElement as HTMLElement ;
21- expect ( compiled . querySelector ( 'h1' ) ?. textContent ) . toContain ( 'Hello, temp' ) ;
29+ expect ( compiled . querySelector ( 'main' ) ) . toBeTruthy ( ) ;
30+ expect ( compiled . querySelector ( 'router-outlet' ) ) . toBeTruthy ( ) ;
2231 } ) ;
2332} ) ;
You can’t perform that action at this time.
0 commit comments