bug resolve

This commit is contained in:
gaurav
2022-08-31 17:20:17 +05:30
parent bcc71ce2e1
commit 0840bfd8ce

View File

@@ -11,13 +11,12 @@ import { PaginatedSearchOptions } from '../../shared/search/models/paginated-sea
import { PaginationComponentOptions } from '../../shared/pagination/pagination-component-options.model'; import { PaginationComponentOptions } from '../../shared/pagination/pagination-component-options.model';
import { SortDirection, SortOptions } from '../../core/cache/models/sort-options.model'; import { SortDirection, SortOptions } from '../../core/cache/models/sort-options.model';
import { ViewMode } from 'src/app/core/shared/view-mode.model'; import { ViewMode } from 'src/app/core/shared/view-mode.model';
import { of as observableOf } from 'rxjs';
describe('RecentItemListComponent', () => { describe('RecentItemListComponent', () => {
let component: RecentItemListComponent; let component: RecentItemListComponent;
let fixture: ComponentFixture<RecentItemListComponent>; let fixture: ComponentFixture<RecentItemListComponent>;
const emptyList = createSuccessfulRemoteDataObject(createPaginatedList([])); const emptyList = createSuccessfulRemoteDataObject(createPaginatedList([]));
let paginationService; let paginationService;
let searchConfigService: SearchConfigurationService;
const searchServiceStub = Object.assign(new SearchServiceStub(), { const searchServiceStub = Object.assign(new SearchServiceStub(), {
search: () => observableOf(emptyList), search: () => observableOf(emptyList),
/* eslint-disable no-empty,@typescript-eslint/no-empty-function */ /* eslint-disable no-empty,@typescript-eslint/no-empty-function */
@@ -60,11 +59,8 @@ describe('RecentItemListComponent', () => {
it('should call the navigate method on the Router with view mode list parameter as a parameter when setViewMode is called', () => { it('should call the navigate method on the Router with view mode list parameter as a parameter when setViewMode is called', () => {
component.onLoadMore(); component.onLoadMore();
expect(paginationService.updateRouteWithUrl).toHaveBeenCalledWith('page-id', ['/search'], {page: 1},{ view: ViewMode.ListElement } expect(paginationService.updateRouteWithUrl).toHaveBeenCalledWith(undefined, ['search'], Object({ sortField: 'dc.date.accessioned', sortDirection: 'DESC', page: 1 }));
);
}); });
}); });
function observableOf(emptyList: any): any {
throw new Error('Function not implemented.');
}