1- import { async , TestBed } from '@angular/core/testing' ;
1+ import { waitForAsync , TestBed } from '@angular/core/testing' ;
22import { RouterTestingModule } from '@angular/router/testing' ;
33import { AppComponent } from './app.component' ;
4+ import { AppStoreService } from './services/app-store.service' ;
5+ import { ClipboardService } from './services/clipboard.service' ;
6+ import { ProjectApiService } from './services/api/project-api.service' ;
7+ import { HttpClientTestingModule } from '@angular/common/http/testing' ;
8+ import { EnvironmentProvider } from '../environments/environment.provider' ;
9+ import { WebSocketService } from './services/websocket.service' ;
10+ import { WebSocketAPIService } from './services/api/websocket-api.service' ;
411
512describe ( 'AppComponent' , ( ) => {
6- beforeEach ( async ( ( ) => {
13+ beforeEach ( waitForAsync ( ( ) => {
714 TestBed . configureTestingModule ( {
815 imports : [
9- RouterTestingModule
16+ RouterTestingModule ,
17+ HttpClientTestingModule
1018 ] ,
1119 declarations : [
1220 AppComponent
21+ ] ,
22+ providers : [
23+ AppStoreService ,
24+ ClipboardService ,
25+ ProjectApiService ,
26+ EnvironmentProvider ,
27+ WebSocketService ,
28+ WebSocketAPIService
1329 ]
1430 } ) . compileComponents ( ) ;
1531 } ) ) ;
@@ -19,17 +35,4 @@ describe('AppComponent', () => {
1935 const app = fixture . debugElement . componentInstance ;
2036 expect ( app ) . toBeTruthy ( ) ;
2137 } ) ;
22-
23- it ( `should have as title 'alex-frontend'` , ( ) => {
24- const fixture = TestBed . createComponent ( AppComponent ) ;
25- const app = fixture . debugElement . componentInstance ;
26- expect ( app . title ) . toEqual ( 'alex-frontend' ) ;
27- } ) ;
28-
29- it ( 'should render title' , ( ) => {
30- const fixture = TestBed . createComponent ( AppComponent ) ;
31- fixture . detectChanges ( ) ;
32- const compiled = fixture . debugElement . nativeElement ;
33- expect ( compiled . querySelector ( '.content span' ) . textContent ) . toContain ( 'alex-frontend app is running!' ) ;
34- } ) ;
3538} ) ;
0 commit comments