mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-13 04:53:06 +00:00
76654: Implement feedback
This commit is contained in:
25
src/app/shared/testing/pagination-service.stub.ts
Normal file
25
src/app/shared/testing/pagination-service.stub.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import { of as observableOf } from 'rxjs';
|
||||
import { PaginationComponentOptions } from '../pagination/pagination-component-options.model';
|
||||
import { SortDirection, SortOptions } from '../../core/cache/models/sort-options.model';
|
||||
import { FindListOptions } from '../../core/data/request.models';
|
||||
|
||||
export class PaginationServiceStub {
|
||||
|
||||
constructor(
|
||||
public pagination = Object.assign(new PaginationComponentOptions(), {currentPage: 1, pageSize: 20}),
|
||||
public sort = new SortOptions('score', SortDirection.DESC),
|
||||
public findlistOptions = Object.assign(new FindListOptions(), {currentPage: 1, elementsPerPage: 20}),
|
||||
) {
|
||||
}
|
||||
|
||||
getCurrentPagination = jasmine.createSpy('getCurrentPagination').and.returnValue(observableOf(this.pagination));
|
||||
getCurrentSort = jasmine.createSpy('getCurrentSort').and.returnValue(observableOf(this.sort));
|
||||
getFindListOptions = jasmine.createSpy('getFindListOptions').and.returnValue(observableOf(this.findlistOptions));
|
||||
resetPage = jasmine.createSpy('resetPage');
|
||||
updateRoute = jasmine.createSpy('updateRoute');
|
||||
updateRouteWithUrl = jasmine.createSpy('updateRouteWithUrl');
|
||||
clearPagination = jasmine.createSpy('clearPagination');
|
||||
getRouteParameterValue = jasmine.createSpy('getRouteParameterValue').and.returnValue(observableOf(''));
|
||||
getPageParam = jasmine.createSpy('getPageParam').and.returnValue(`p.${this.pagination.id}`);
|
||||
|
||||
}
|
Reference in New Issue
Block a user