mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[ADF-2016] pagination integration for document list (#2718)
* pagination integration for document list * reload data only if needed * unit tests for document list * pagination tests * update docs
This commit is contained in:
committed by
Eugenio Romano
parent
d77db4e8f6
commit
a9d61e5d6e
@@ -1103,4 +1103,47 @@ describe('DocumentList', () => {
|
||||
|
||||
expect(documentList.folderNode).toBeNull();
|
||||
});
|
||||
|
||||
it('should update pagination settings', () => {
|
||||
spyOn(documentList, 'reload').and.stub();
|
||||
|
||||
documentList.maxItems = 0;
|
||||
documentList.skipCount = 0;
|
||||
|
||||
documentList.updatePagination({
|
||||
maxItems: 10,
|
||||
skipCount: 10
|
||||
});
|
||||
|
||||
expect(documentList.maxItems).toBe(10);
|
||||
expect(documentList.skipCount).toBe(10);
|
||||
});
|
||||
|
||||
it('should reload data upon changing pagination settings', () => {
|
||||
spyOn(documentList, 'reload').and.stub();
|
||||
|
||||
documentList.maxItems = 0;
|
||||
documentList.skipCount = 0;
|
||||
|
||||
documentList.updatePagination({
|
||||
maxItems: 10,
|
||||
skipCount: 10
|
||||
});
|
||||
|
||||
expect(documentList.reload).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('should not reload data if pagination settings are same', () => {
|
||||
spyOn(documentList, 'reload').and.stub();
|
||||
|
||||
documentList.maxItems = 10;
|
||||
documentList.skipCount = 10;
|
||||
|
||||
documentList.updatePagination({
|
||||
maxItems: 10,
|
||||
skipCount: 10
|
||||
});
|
||||
|
||||
expect(documentList.reload).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user