[ADF-2221] Search fails on Content Node Selector (#2888)

This commit is contained in:
suzanadirla
2018-01-26 12:25:55 +02:00
committed by Eugenio Romano
parent 0ad4bf6eb9
commit d071250e24
3 changed files with 6 additions and 6 deletions

View File

@@ -124,7 +124,7 @@ describe('ContentNodeSelectorComponent', () => {
component.debounceSearch = 0;
searchService = TestBed.get(SearchService);
searchSpy = spyOn(searchService, 'search').and.callFake(() => {
searchSpy = spyOn(searchService, 'searchByQueryBody').and.callFake(() => {
return Observable.create((observer: Observer<NodePaging>) => {
_observer = observer;
});
@@ -301,7 +301,7 @@ describe('ContentNodeSelectorComponent', () => {
typeToSearchBox('kakarot');
setTimeout(() => {
expect(searchSpy).toHaveBeenCalledWith(defaultSearchOptions('kakarot'), '25', '0');
expect(searchSpy).toHaveBeenCalledWith(defaultSearchOptions('kakarot'));
done();
}, 300);
});
@@ -325,7 +325,7 @@ describe('ContentNodeSelectorComponent', () => {
component.siteChanged(<SiteEntry> { entry: { guid: 'namek' } });
expect(searchSpy.calls.count()).toBe(2, 'Search count should be two after the site change');
expect(searchSpy.calls.argsFor(1)).toEqual([defaultSearchOptions('vegeta', 'namek'), '25', '0'] );
expect(searchSpy.calls.argsFor(1)).toEqual([defaultSearchOptions('vegeta', 'namek')] );
done();
}, 300);
});
@@ -523,7 +523,7 @@ describe('ContentNodeSelectorComponent', () => {
component.getNextPageOfSearch({ skipCount });
expect(searchSpy).toHaveBeenCalledWith(defaultSearchOptions('kakarot', undefined, skipCount), '25', skipCount.toString());
expect(searchSpy).toHaveBeenCalledWith(defaultSearchOptions('kakarot', undefined, skipCount));
});
it('should be shown when pagination\'s hasMoreItems is true', () => {

View File

@@ -22,7 +22,7 @@ import { ContentNodeSelectorService } from './content-node-selector.service';
class SearchServiceMock {
public query: QueryBody;
search(query: QueryBody) {
searchByQueryBody(query: QueryBody) {
this.query = query;
}
}

View File

@@ -59,6 +59,6 @@ export class ContentNodeSelectorService {
}
};
return this.searchService.search(defaultSearchNode, maxItems.toString(), skipCount.toString());
return this.searchService.searchByQueryBody(defaultSearchNode);
}
}