11import { CommonModule } from '@angular/common' ;
22import { NO_ERRORS_SCHEMA } from '@angular/core' ;
3- import { async , ComponentFixture , inject , TestBed } from '@angular/core/testing' ;
4- import { FormsModule , ReactiveFormsModule } from '@angular/forms' ;
3+ import { ComponentFixture , TestBed , waitForAsync } from '@angular/core/testing' ;
54import { BrowserModule , By } from '@angular/platform-browser' ;
65import { RouterTestingModule } from '@angular/router/testing' ;
7- import { NgbModule } from '@ng-bootstrap/ng-bootstrap' ;
86import { TranslateLoader , TranslateModule } from '@ngx-translate/core' ;
97import { Observable } from 'rxjs' ;
108import { RemoteData } from '../../../../core/data/remote-data' ;
@@ -15,12 +13,10 @@ import { FacetValue } from '../../../search/models/facet-value.model';
1513import { FilterType } from '../../../search/models/filter-type.model' ;
1614import { SearchFilterConfig } from '../../../search/models/search-filter-config.model' ;
1715import { FacetSectionComponent } from './facet-section.component' ;
18- import { SEARCH_CONFIG_SERVICE } from '../../../../my-dspace-page/my-dspace-page.component' ;
19- import { SearchConfigurationServiceStub } from '../../../testing/search-configuration-service.stub' ;
20- import { StoreModule } from '@ngrx/store' ;
21- import { authReducer } from '../../../../core/auth/auth.reducer' ;
22- import { storeModuleConfig } from '../../../../app.reducer' ;
23- import { isNotNull } from '../../../empty.util' ;
16+ import { StoreModule } from '@ngrx/store' ;
17+ import { authReducer } from '../../../../core/auth/auth.reducer' ;
18+ import { storeModuleConfig } from '../../../../app.reducer' ;
19+ import { isNotNull } from '../../../empty.util' ;
2420
2521describe ( 'FacetSectionComponent' , ( ) => {
2622 let component : FacetSectionComponent ;
@@ -113,7 +109,7 @@ describe('FacetSectionComponent', () => {
113109 values : [ pieChartFacetValue ]
114110 }
115111 } ) ;
116- beforeEach ( async ( ( ) => {
112+ beforeEach ( waitForAsync ( ( ) => {
117113
118114 searchServiceStub = {
119115 searchFacets ( scope ?: string , configurationName ?: string ) : Observable < RemoteData < SearchFilterConfig [ ] > > {
@@ -125,7 +121,9 @@ describe('FacetSectionComponent', () => {
125121 } ;
126122
127123 TestBed . configureTestingModule ( {
128- imports : [ CommonModule , NgbModule , FormsModule , ReactiveFormsModule , BrowserModule , RouterTestingModule ,
124+ imports : [ CommonModule ,
125+ BrowserModule ,
126+ RouterTestingModule ,
129127 StoreModule . forRoot ( { auth : authReducer } , storeModuleConfig ) ,
130128 TranslateModule . forRoot ( {
131129 loader : {
@@ -135,9 +133,9 @@ describe('FacetSectionComponent', () => {
135133 } ) ,
136134 ] ,
137135 declarations : [ FacetSectionComponent ] ,
138- providers : [ FacetSectionComponent ,
139- { provide : SearchService , useValue : searchServiceStub } ,
140- { provide : SEARCH_CONFIG_SERVICE , useValue : new SearchConfigurationServiceStub ( ) } ] ,
136+ providers : [
137+ { provide : SearchService , useValue : searchServiceStub }
138+ ] ,
141139 schemas : [ NO_ERRORS_SCHEMA ]
142140 } ) . compileComponents ( ) ;
143141
@@ -158,9 +156,9 @@ describe('FacetSectionComponent', () => {
158156 fixture . detectChanges ( ) ;
159157 } ) ;
160158
161- it ( 'should create FacetSectionComponent' , inject ( [ FacetSectionComponent ] , ( comp : FacetSectionComponent ) => {
162- expect ( comp ) . toBeDefined ( ) ;
163- } ) ) ;
159+ it ( 'should create FacetSectionComponent' , ( ) => {
160+ expect ( component ) . toBeDefined ( ) ;
161+ } ) ;
164162
165163 it ( 'should create a facet section foreach not empty filter configs' , ( ) => {
166164 // graph facets control
0 commit comments