mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-2221] Search fails on Content Node Selector (#2888)
This commit is contained in:
committed by
Eugenio Romano
parent
0ad4bf6eb9
commit
d071250e24
@@ -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', () => {
|
||||
|
@@ -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;
|
||||
}
|
||||
}
|
||||
|
@@ -59,6 +59,6 @@ export class ContentNodeSelectorService {
|
||||
}
|
||||
};
|
||||
|
||||
return this.searchService.search(defaultSearchNode, maxItems.toString(), skipCount.toString());
|
||||
return this.searchService.searchByQueryBody(defaultSearchNode);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user