mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
* [#5352] Fix broken pagination if totalItems is missing. This happens when a search query is executed against Solr and not the DB * fix lint issues Co-authored-by: Arik Sidney Guggenheim <ariksidney@outlook.com>
This commit is contained in:
@@ -347,4 +347,27 @@ describe('PaginationComponent', () => {
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('without total items', () => {
|
||||
beforeEach(() => {
|
||||
component.pagination = new FakePaginationInput(3, 2, 5);
|
||||
component.pagination.hasMoreItems = true;
|
||||
component.pagination.totalItems = undefined;
|
||||
});
|
||||
|
||||
it('has the same, previous page', () => {
|
||||
expect(component.previous).toBe(1);
|
||||
});
|
||||
|
||||
it('has next page', () => {
|
||||
expect(component.next).toBe(3);
|
||||
});
|
||||
|
||||
it('has range', () => {
|
||||
expect(component.range).toEqual([ 26, 50 ]);
|
||||
});
|
||||
it('cannot calculate number of pages', () => {
|
||||
expect(component.pages).toEqual([1]);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user