mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
Fix issue with clear pagination test
This commit is contained in:
@@ -128,16 +128,25 @@ describe('PaginationService', () => {
|
|||||||
|
|
||||||
});
|
});
|
||||||
describe('clearPagination', () => {
|
describe('clearPagination', () => {
|
||||||
it('should clear the pagination info from the route for the current id', () => {
|
it('should clear the pagination next time the updateRoute/updateRouteWithUrl method is called', () => {
|
||||||
service.clearPagination('test');
|
service.clearPagination('test');
|
||||||
|
|
||||||
const params = {};
|
const resetParams = {};
|
||||||
params[`p.test`] = null;
|
resetParams[`p.test`] = null;
|
||||||
params[`rpp.test`] = null;
|
resetParams[`rpp.test`] = null;
|
||||||
params[`sf.test`] = null;
|
resetParams[`sf.test`] = null;
|
||||||
params[`sd.test`] = null;
|
resetParams[`sd.test`] = null;
|
||||||
|
|
||||||
expect(router.navigate).toHaveBeenCalledWith([], {queryParams: params, queryParamsHandling: 'merge'});
|
|
||||||
|
const navigateParams = {};
|
||||||
|
navigateParams[`p.another-id`] = `5`;
|
||||||
|
navigateParams[`rpp.another-id`] = `10`;
|
||||||
|
navigateParams[`sf.another-id`] = `score`;
|
||||||
|
navigateParams[`sd.another-id`] = `ASC`;
|
||||||
|
|
||||||
|
service.updateRoute('another-id', {});
|
||||||
|
|
||||||
|
expect(router.navigate).toHaveBeenCalledWith([], {queryParams: Object.assign({}, resetParams, navigateParams), queryParamsHandling: 'merge'});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
describe('getPageParam', () => {
|
describe('getPageParam', () => {
|
||||||
|
Reference in New Issue
Block a user