Skip to content

Commit 5b0e7c1

Browse files
author
Jens Vannerum
committed
122064: fix specs
1 parent 2d64c1c commit 5b0e7c1

4 files changed

Lines changed: 5 additions & 2 deletions

File tree

src/app/browse-by/browse-by-date/browse-by-date.component.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ describe('BrowseByDateComponent', () => {
8585
getBrowseEntriesFor: (options: BrowseEntrySearchOptions) => toRemoteData([]),
8686
getBrowseItemsFor: (value: string, options: BrowseEntrySearchOptions) => toRemoteData([firstItem]),
8787
getFirstItemFor: (definition: string, scope?: string, sortDirection?: SortDirection) => null,
88+
getConfiguredSortDirection: () => observableOf(SortDirection.DESC),
8889
};
8990

9091
const mockDsoService = {

src/app/browse-by/browse-by-date/browse-by-date.component.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,9 @@ export class BrowseByDateComponent extends BrowseByMetadataComponent implements
118118
})).subscribe(({ params, currentPage, currentSort }) => {
119119
const metadataKeys = params.browseDefinition ? params.browseDefinition.metadataKeys : this.defaultMetadataKeys;
120120
this.startsWith = +params.startsWith || params.startsWith;
121+
this.browseId = params.id || this.defaultBrowseId;
121122
const searchOptions = browseParamsToOptions(params, currentPage, currentSort, this.browseId, this.fetchThumbnails);
122123
this.updatePageWithItems(searchOptions, this.value, undefined);
123-
this.updateParent(params.scope);
124-
this.updateLogo();
125124
this.updateStartsWithOptions(this.browseId, metadataKeys, params.scope);
126125
})
127126
);

src/app/browse-by/browse-by-metadata/browse-by-metadata.component.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ describe('BrowseByMetadataComponent', () => {
112112
const mockBrowseService = {
113113
getBrowseEntriesFor: (options: BrowseEntrySearchOptions) => toRemoteData(mockEntries),
114114
getBrowseItemsFor: (value: string, options: BrowseEntrySearchOptions) => toRemoteData(mockItems),
115+
getConfiguredSortDirection: () => observableOf(SortDirection.ASC),
115116
};
116117

117118
const mockDsoService = {

src/app/browse-by/browse-by-title/browse-by-title.component.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ import { EnumKeysPipe } from '../../shared/utils/enum-keys-pipe';
4141
import { VarDirective } from '../../shared/utils/var.directive';
4242
import { toRemoteData } from '../browse-by-metadata/browse-by-metadata.component.spec';
4343
import { BrowseByTitleComponent } from './browse-by-title.component';
44+
import { SortDirection } from '../../core/cache/models/sort-options.model';
4445

4546
describe('BrowseByTitleComponent', () => {
4647
let comp: BrowseByTitleComponent;
@@ -73,6 +74,7 @@ describe('BrowseByTitleComponent', () => {
7374
const mockBrowseService = {
7475
getBrowseItemsFor: () => toRemoteData(mockItems),
7576
getBrowseEntriesFor: () => toRemoteData([]),
77+
getConfiguredSortDirection: () => observableOf(SortDirection.ASC),
7678
};
7779

7880
const mockDsoService = {

0 commit comments

Comments
 (0)