mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-18 07:23:03 +00:00
107671: Fix handle theme not working with canonical prefix https://hdl.handle.net/
(cherry picked from commit a7faf7d449
)
This commit is contained in:

committed by
github-actions[bot]
![github-actions[bot]](/assets/img/avatar_default.png)
parent
626cc30738
commit
d3fdfebde1
@@ -1,4 +1,4 @@
|
||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
import { ComponentFixture, TestBed, waitForAsync, fakeAsync, flush } from '@angular/core/testing';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { CurationFormComponent } from './curation-form.component';
|
||||
@@ -16,6 +16,7 @@ import { ConfigurationDataService } from '../core/data/configuration-data.servic
|
||||
import { ConfigurationProperty } from '../core/shared/configuration-property.model';
|
||||
import { getProcessDetailRoute } from '../process-page/process-page-routing.paths';
|
||||
import { HandleService } from '../shared/handle.service';
|
||||
import { of as observableOf } from 'rxjs';
|
||||
|
||||
describe('CurationFormComponent', () => {
|
||||
let comp: CurationFormComponent;
|
||||
@@ -54,7 +55,7 @@ describe('CurationFormComponent', () => {
|
||||
});
|
||||
|
||||
handleService = {
|
||||
normalizeHandle: (a) => a
|
||||
normalizeHandle: (a: string) => observableOf(a),
|
||||
} as any;
|
||||
|
||||
notificationsService = new NotificationsServiceStub();
|
||||
@@ -151,12 +152,13 @@ describe('CurationFormComponent', () => {
|
||||
], []);
|
||||
});
|
||||
|
||||
it(`should show an error notification and return when an invalid dsoHandle is provided`, () => {
|
||||
it(`should show an error notification and return when an invalid dsoHandle is provided`, fakeAsync(() => {
|
||||
comp.dsoHandle = 'test-handle';
|
||||
spyOn(handleService, 'normalizeHandle').and.returnValue(null);
|
||||
spyOn(handleService, 'normalizeHandle').and.returnValue(observableOf(null));
|
||||
comp.submit();
|
||||
flush();
|
||||
|
||||
expect(notificationsService.error).toHaveBeenCalled();
|
||||
expect(scriptDataService.invoke).not.toHaveBeenCalled();
|
||||
});
|
||||
}));
|
||||
});
|
||||
|
Reference in New Issue
Block a user