@@ -15,6 +15,7 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations';
1515import { ActivatedRoute } from '@angular/router' ;
1616import { RouterTestingModule } from '@angular/router/testing' ;
1717import { APP_CONFIG } from '@dspace/config/app-config.interface' ;
18+ import { SearchManager } from '@dspace/core/browse/search-manager' ;
1819import {
1920 SortDirection ,
2021 SortOptions ,
@@ -138,6 +139,9 @@ const searchServiceStub = jasmine.createSpyObj('SearchService', {
138139 getSearchConfigurationFor : createSuccessfulRemoteDataObject$ ( searchConfig ) ,
139140 trackSearch : { } ,
140141} ) as SearchService ;
142+ const searchManagerStub = jasmine . createSpyObj ( 'SearchManager' , {
143+ search : mockResultsRD$ ,
144+ } ) ;
141145const queryParam = 'test query' ;
142146const hiddenQuery = 'hidden query' ;
143147const scopeParam = '7669c72a-3f2a-451f-a3b9-9210e7a4c02f' ;
@@ -216,6 +220,7 @@ export function configureSearchComponentTestingModule(compType, additionalDeclar
216220 imports : [ TranslateModule . forRoot ( ) , RouterTestingModule . withRoutes ( [ ] ) , NoopAnimationsModule , NgbCollapseModule , compType , ...additionalDeclarations ] ,
217221 providers : [
218222 { provide : SearchService , useValue : searchServiceStub } ,
223+ { provide : SearchManager , useValue : searchManagerStub } ,
219224 {
220225 provide : CommunityDataService ,
221226 useValue : jasmine . createSpyObj ( 'communityService' , [ 'findById' , 'findAll' ] ) ,
@@ -443,7 +448,7 @@ describe('SearchComponent', () => {
443448 comp . ngOnInit ( ) ;
444449 tick ( 100 ) ;
445450 //Check that the last method from which the search depend upon is being called
446- expect ( searchServiceStub . search ) . toHaveBeenCalled ( ) ;
451+ expect ( searchManagerStub . search ) . toHaveBeenCalled ( ) ;
447452 } ) ) ;
448453 } ) ;
449454 } ) ;
0 commit comments