Skip to content

Commit c37f216

Browse files
[DURACOM-426] fix test
1 parent d8a3873 commit c37f216

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

src/app/shared/metadata-link-view/metadata-link-view-popover/metadata-link-view-popover.component.spec.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ describe('MetadataLinkViewPopoverComponent', () => {
116116

117117
it('should retrieve the identifier subtype configuration based on the given metadata value', () => {
118118
const metadataValue = 'organization.identifier.ror';
119-
const expectedSubtypeConfig = environment.identifierSubtypes.find((config) => config.name === 'ror');
119+
const expectedSubtypeConfig = environment.item.metadataLinkViewPopoverData.identifierSubtypes.find((config) => config.name === 'ror');
120120
expect(component.getSourceSubTypeIdentifier(metadataValue)).toEqual(expectedSubtypeConfig);
121121
});
122122

@@ -152,6 +152,7 @@ describe('MetadataLinkViewPopoverComponent', () => {
152152
},
153153
],
154154
fallbackMetdataList: [],
155+
identifierSubtypes: [],
155156
};
156157

157158
const title = component.getTitleFromMetadataList();
@@ -168,6 +169,7 @@ describe('MetadataLinkViewPopoverComponent', () => {
168169
},
169170
],
170171
fallbackMetdataList: [],
172+
identifierSubtypes: [],
171173
};
172174

173175
const title = component.getTitleFromMetadataList();

src/app/shared/search/search.component.spec.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations';
1515
import { ActivatedRoute } from '@angular/router';
1616
import { RouterTestingModule } from '@angular/router/testing';
1717
import { APP_CONFIG } from '@dspace/config/app-config.interface';
18+
import { SearchManager } from '@dspace/core/browse/search-manager';
1819
import {
1920
SortDirection,
2021
SortOptions,
@@ -138,6 +139,9 @@ const searchServiceStub = jasmine.createSpyObj('SearchService', {
138139
getSearchConfigurationFor: createSuccessfulRemoteDataObject$(searchConfig),
139140
trackSearch: {},
140141
}) as SearchService;
142+
const searchManagerStub = jasmine.createSpyObj('SearchManager', {
143+
search: mockResultsRD$,
144+
});
141145
const queryParam = 'test query';
142146
const hiddenQuery = 'hidden query';
143147
const scopeParam = '7669c72a-3f2a-451f-a3b9-9210e7a4c02f';
@@ -216,6 +220,7 @@ export function configureSearchComponentTestingModule(compType, additionalDeclar
216220
imports: [TranslateModule.forRoot(), RouterTestingModule.withRoutes([]), NoopAnimationsModule, NgbCollapseModule, compType, ...additionalDeclarations],
217221
providers: [
218222
{ provide: SearchService, useValue: searchServiceStub },
223+
{ provide: SearchManager, useValue: searchManagerStub },
219224
{
220225
provide: CommunityDataService,
221226
useValue: jasmine.createSpyObj('communityService', ['findById', 'findAll']),
@@ -443,7 +448,7 @@ describe('SearchComponent', () => {
443448
comp.ngOnInit();
444449
tick(100);
445450
//Check that the last method from which the search depend upon is being called
446-
expect(searchServiceStub.search).toHaveBeenCalled();
451+
expect(searchManagerStub.search).toHaveBeenCalled();
447452
}));
448453
});
449454
});

0 commit comments

Comments
 (0)