1616 * limitations under the License.
1717 */
1818
19- import { async , ComponentFixture , TestBed } from '@angular/core/testing' ;
20-
19+ import { async , ComponentFixture , TestBed , inject } from '@angular/core/testing' ;
20+ import { HttpClientTestingModule , HttpTestingController } from '@angular/common/http/testing' ;
21+ import { HttpClientModule , HttpClient } from '@angular/common/http' ;
22+ import { BrowserAnimationsModule } from '@angular/platform-browser/animations' ;
23+ import { MatTableModule , MatInputModule } from '@angular/material' ;
24+ import { MatFormFieldModule } from '@angular/material/form-field' ;
25+ import { MatCheckboxModule } from '@angular/material/checkbox' ;
26+ import { MatIconModule } from '@angular/material/icon' ;
27+ import { MatDialogModule } from '@angular/material/dialog' ;
28+ import { TableAllComponent } from '../table-all/table-all.component' ;
2129import { CrawlerComponent } from './crawler.component' ;
30+ import { ApiService } from '../../api' ;
2231
2332describe ( 'CrawlerComponent' , ( ) => {
2433 let component : CrawlerComponent ;
2534 let fixture : ComponentFixture < CrawlerComponent > ;
2635
2736 beforeEach ( async ( ( ) => {
2837 TestBed . configureTestingModule ( {
29- declarations : [ CrawlerComponent ]
38+ declarations : [ CrawlerComponent , TableAllComponent ] ,
39+ imports : [ HttpClientTestingModule , HttpClientModule , BrowserAnimationsModule ,
40+ MatTableModule , MatInputModule , MatFormFieldModule , MatCheckboxModule , MatIconModule , MatDialogModule ]
3041 } )
3142 . compileComponents ( ) ;
3243 } ) ) ;
@@ -37,7 +48,8 @@ describe('CrawlerComponent', () => {
3748 fixture . detectChanges ( ) ;
3849 } ) ;
3950
40- it ( 'should create' , ( ) => {
41- expect ( component ) . toBeTruthy ( ) ;
42- } ) ;
51+ it ( `should create` , async ( inject ( [ HttpTestingController , ApiService ] ,
52+ ( httpClient : HttpTestingController , apiService : ApiService ) => {
53+ expect ( apiService ) . toBeTruthy ( ) ;
54+ } ) ) ) ;
4355} ) ;
0 commit comments