mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
update pagination on count 0 (#3228)
This commit is contained in:
committed by
Eugenio Romano
parent
8f27cd1758
commit
95a2a54017
@@ -303,5 +303,30 @@ describe('PaginationComponent', () => {
|
||||
expect(component.current).toBe(2);
|
||||
});
|
||||
|
||||
it('should go to previous page if current page has 0 items', () => {
|
||||
const customComponent = <PaginatedComponent> {
|
||||
updatePagination() {},
|
||||
pagination: new BehaviorSubject<Pagination>({})
|
||||
};
|
||||
|
||||
component.target = customComponent;
|
||||
component.ngOnInit();
|
||||
|
||||
customComponent.pagination.next({
|
||||
count: 2,
|
||||
skipCount: 5,
|
||||
maxItems: 5
|
||||
});
|
||||
|
||||
expect(component.current).toBe(2);
|
||||
|
||||
customComponent.pagination.next({
|
||||
count: 0,
|
||||
totalItems: 5,
|
||||
maxItems: 5
|
||||
});
|
||||
|
||||
expect(component.current).toBe(1);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user