mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
fix ProfilePageMetadataFormComponent tests
This commit is contained in:
@@ -10,6 +10,9 @@ import { NotificationsService } from '../../shared/notifications/notifications.s
|
|||||||
import { EPersonDataService } from '../../core/eperson/eperson-data.service';
|
import { EPersonDataService } from '../../core/eperson/eperson-data.service';
|
||||||
import cloneDeep from 'lodash/cloneDeep';
|
import cloneDeep from 'lodash/cloneDeep';
|
||||||
import { createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils';
|
import { createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils';
|
||||||
|
import { FormComponent } from '../../shared/form/form.component';
|
||||||
|
import { ConfigurationDataService } from 'src/app/core/data/configuration-data.service';
|
||||||
|
import { of } from 'rxjs';
|
||||||
|
|
||||||
describe('ProfilePageMetadataFormComponent', () => {
|
describe('ProfilePageMetadataFormComponent', () => {
|
||||||
let component: ProfilePageMetadataFormComponent;
|
let component: ProfilePageMetadataFormComponent;
|
||||||
@@ -20,6 +23,7 @@ describe('ProfilePageMetadataFormComponent', () => {
|
|||||||
let epersonService;
|
let epersonService;
|
||||||
let notificationsService;
|
let notificationsService;
|
||||||
let translate;
|
let translate;
|
||||||
|
let configurationDataService;
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
user = Object.assign(new EPerson(), {
|
user = Object.assign(new EPerson(), {
|
||||||
@@ -59,6 +63,10 @@ describe('ProfilePageMetadataFormComponent', () => {
|
|||||||
onLangChange: new EventEmitter()
|
onLangChange: new EventEmitter()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
configurationDataService = jasmine.createSpyObj('ConfigurationDataService', {
|
||||||
|
findByPropertyName: of({payload: {value: 'test'}}),
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
beforeEach(waitForAsync(() => {
|
beforeEach(waitForAsync(() => {
|
||||||
@@ -69,10 +77,15 @@ describe('ProfilePageMetadataFormComponent', () => {
|
|||||||
{ provide: EPersonDataService, useValue: epersonService },
|
{ provide: EPersonDataService, useValue: epersonService },
|
||||||
{ provide: TranslateService, useValue: translate },
|
{ provide: TranslateService, useValue: translate },
|
||||||
{ provide: NotificationsService, useValue: notificationsService },
|
{ provide: NotificationsService, useValue: notificationsService },
|
||||||
|
{ provide: ConfigurationDataService, useValue: configurationDataService },
|
||||||
FormBuilderService
|
FormBuilderService
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA]
|
||||||
}).compileComponents();
|
})
|
||||||
|
.overrideComponent(ProfilePageMetadataFormComponent, {
|
||||||
|
remove: { imports: [FormComponent]}
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
}));
|
}));
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
Reference in New Issue
Block a user