Fix pageSize value fetch for infinite pagination (#4073)

- uses pageSize defined on the component or by the UserPreferencesService
if not defined
This commit is contained in:
Nicolas Barithel
2018-12-13 15:20:20 +01:00
committed by Eugenio Romano
parent bdef2642e7
commit 411166605e
2 changed files with 16 additions and 3 deletions

View File

@@ -139,7 +139,17 @@ describe('InfinitePaginationComponent', () => {
component.onLoadMore();
expect(testTarget.updatePagination).toHaveBeenCalledWith({ maxItems: 469, skipCount: 0, totalItems: 888, hasMoreItems: true, merge: true });
expect(testTarget.updatePagination).toHaveBeenCalledWith({ maxItems: 444 + 25, skipCount: 0, totalItems: 888, hasMoreItems: true, merge: true });
});
it('should call the target\'s updatePagination on invoking the onLoadMore with a specific pageSize', () => {
component.target = testTarget;
component.pageSize = 7;
fixture.detectChanges();
component.onLoadMore();
expect(testTarget.updatePagination).toHaveBeenCalledWith({ maxItems: 444 + component.pageSize, skipCount: 0, totalItems: 888, hasMoreItems: true, merge: true });
});
it('should unsubscribe from the target\'s pagination on onDestroy', () => {