[ADF-3930] fix infinite pagination (#4275)

* refactoring infinite pagination

* fix lint

* fix import reuqest pagination from core

* fix failing unit test
This commit is contained in:
Eugenio Romano
2019-02-06 14:40:38 +00:00
committed by GitHub
parent 3a9958988a
commit d6b8e85c35
20 changed files with 198 additions and 109 deletions

View File

@@ -1269,6 +1269,24 @@ describe('DocumentList', () => {
documentList.ngOnChanges({ currentFolderId: new SimpleChange(null, '-root-', false) });
expect(documentListService.getFolder).toHaveBeenCalledWith(null, {
where: undefined,
maxItems: 25,
skipCount: 0,
rootFolderId: 'fake-id'
}, ['test-include']);
});
it('should add where in the server request when present', () => {
fixture.detectChanges();
documentList.currentFolderId = 'fake-id';
documentList.includeFields = ['test-include'];
documentList.where = '(isFolder=true)';
spyOn(documentListService, 'getFolder').and.callThrough();
documentList.ngOnChanges({ currentFolderId: new SimpleChange(null, '-root-', false) });
expect(documentListService.getFolder).toHaveBeenCalledWith(null, {
where: '(isFolder=true)',
maxItems: 25,
skipCount: 0,
rootFolderId: 'fake-id'