mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-16 22:43:03 +00:00
[CST-4878] Finished working on embargo add part of form and unit testing
This commit is contained in:
44
src/app/shared/mocks/section-accesses-config.service.mock.ts
Normal file
44
src/app/shared/mocks/section-accesses-config.service.mock.ts
Normal file
@@ -0,0 +1,44 @@
|
||||
import { SubmissionFormsConfigService } from '../../core/config/submission-forms-config.service';
|
||||
import { SubmissionFormsModel } from 'src/app/core/config/models/config-submission-forms.model';
|
||||
import { createSuccessfulRemoteDataObject$ } from 'src/app/shared/remote-data.utils';
|
||||
|
||||
const configRes = Object.assign(new SubmissionFormsModel(), {
|
||||
'id': 'AccessConditionDefaultConfiguration',
|
||||
'canChangeDiscoverable': true,
|
||||
'accessConditionOptions': [
|
||||
{
|
||||
'name': 'openaccess',
|
||||
'hasStartDate': false,
|
||||
'hasEndDate': false
|
||||
},
|
||||
{
|
||||
'name': 'lease',
|
||||
'hasStartDate': false,
|
||||
'hasEndDate': true,
|
||||
'maxEndDate': '2022-06-20T12:17:44.420+00:00'
|
||||
},
|
||||
{
|
||||
'name': 'embargo',
|
||||
'hasStartDate': true,
|
||||
'hasEndDate': false,
|
||||
'maxStartDate': '2024-12-20T12:17:44.420+00:00'
|
||||
},
|
||||
{
|
||||
'name': 'administrator',
|
||||
'hasStartDate': false,
|
||||
'hasEndDate': false
|
||||
}
|
||||
],
|
||||
'type': 'submissionaccessoption',
|
||||
'_links': {
|
||||
'self': {
|
||||
'href': 'http://localhost:8080/server/api/config/submissionaccessoptions/AccessConditionDefaultConfiguration'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
export function getSubmissionAccessesConfigService(): SubmissionFormsConfigService {
|
||||
return jasmine.createSpyObj('SubmissionAccessesConfigService', {
|
||||
findByHref: createSuccessfulRemoteDataObject$(configRes),
|
||||
});
|
||||
}
|
Reference in New Issue
Block a user