[ADF-4042] fix reset pagination issue when enter in a folder (#4281)

* fix reset pagination issue when enter in a folder

* fix pagination new folder issue and infintie pagiantion
This commit is contained in:
Eugenio Romano
2019-02-07 21:30:46 +00:00
committed by GitHub
parent 9915935714
commit 8fa335aced
6 changed files with 83 additions and 56 deletions

View File

@@ -742,17 +742,21 @@ describe('ContentNodeSelectorComponent', () => {
});
it('button callback should load the next batch of folder results when there is no searchTerm', () => {
const skipCount = 5;
component.searchTerm = '';
fixture.detectChanges();
component.getNextPageOfSearch({ skipCount });
component.getNextPageOfSearch({
hasMoreItems: false,
skipCount: 10,
maxItems: 45,
totalItems: 0
});
fixture.detectChanges();
expect(component.searchTerm).toBe('');
expect(component.infiniteScroll).toBeTruthy();
expect(component.skipCount).toBe(skipCount);
expect(component.pagination.maxItems).toBe(45);
expect(searchSpy).not.toHaveBeenCalled();
});