mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
go back to the setup where mockUploadConfigResponseNotRequired starts from a clone
This commit is contained in:
@@ -1336,104 +1336,9 @@ export const mockUploadConfigResponse = {
|
|||||||
self: 'https://rest.api/dspace-spring-rest/api/config/submissionuploads/upload'
|
self: 'https://rest.api/dspace-spring-rest/api/config/submissionuploads/upload'
|
||||||
};
|
};
|
||||||
|
|
||||||
export const mockUploadConfigResponseNotRequired = {
|
|
||||||
accessConditionOptions: [
|
|
||||||
{
|
|
||||||
name: 'openaccess',
|
|
||||||
groupUUID: '123456-g',
|
|
||||||
hasStartDate: false,
|
|
||||||
hasEndDate: false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'lease',
|
|
||||||
groupUUID: '123456-g',
|
|
||||||
hasStartDate: false,
|
|
||||||
hasEndDate: true,
|
|
||||||
maxEndDate: '2019-07-12T14:40:06.308+0000'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'embargo',
|
|
||||||
groupUUID: '123456-g',
|
|
||||||
hasStartDate: true,
|
|
||||||
hasEndDate: false,
|
|
||||||
maxStartDate: '2022-01-12T14:40:06.308+0000'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'administrator',
|
|
||||||
groupUUID: '0f2773dd-1741-475f-80e7-ccdef153d655',
|
|
||||||
hasStartDate: false,
|
|
||||||
hasEndDate: false
|
|
||||||
}
|
|
||||||
],
|
|
||||||
metadata: {
|
|
||||||
rows: [
|
|
||||||
{
|
|
||||||
fields: [
|
|
||||||
{
|
|
||||||
input: {
|
|
||||||
type: 'onebox'
|
|
||||||
},
|
|
||||||
label: 'Title',
|
|
||||||
mandatory: true,
|
|
||||||
repeatable: false,
|
|
||||||
mandatoryMessage: 'You must enter a main title for this item.',
|
|
||||||
hints: 'Enter the name of the file.',
|
|
||||||
selectableMetadata: [
|
|
||||||
{
|
|
||||||
metadata: 'dc.title',
|
|
||||||
label: null,
|
|
||||||
authority: null,
|
|
||||||
closed: null
|
|
||||||
}
|
|
||||||
],
|
|
||||||
languageCodes: []
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
fields: [
|
|
||||||
{
|
|
||||||
input: {
|
|
||||||
type: 'textarea'
|
|
||||||
},
|
|
||||||
label: 'Description',
|
|
||||||
mandatory: false,
|
|
||||||
repeatable: true,
|
|
||||||
hints: 'Enter a description for the file',
|
|
||||||
selectableMetadata: [
|
|
||||||
{
|
|
||||||
metadata: 'dc.description',
|
|
||||||
label: null,
|
|
||||||
authority: null,
|
|
||||||
closed: null
|
|
||||||
}
|
|
||||||
],
|
|
||||||
languageCodes: []
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
name: 'bitstream-metadata',
|
|
||||||
type: 'submissionform',
|
|
||||||
_links: {
|
|
||||||
self: 'https://rest.api/dspace-spring-rest/api/config/submissionforms/bitstream-metadata'
|
|
||||||
},
|
|
||||||
self: 'https://rest.api/dspace-spring-rest/api/config/submissionforms/bitstream-metadata'
|
|
||||||
},
|
|
||||||
required: false,
|
|
||||||
maxSize: 536870912,
|
|
||||||
name: 'upload',
|
|
||||||
type: 'submissionupload',
|
|
||||||
_links: {
|
|
||||||
metadata: 'https://rest.api/dspace-spring-rest/api/config/submissionuploads/upload/metadata',
|
|
||||||
self: 'https://rest.api/dspace-spring-rest/api/config/submissionuploads/upload'
|
|
||||||
},
|
|
||||||
self: 'https://rest.api/dspace-spring-rest/api/config/submissionuploads/upload'
|
|
||||||
};
|
|
||||||
|
|
||||||
// Clone the object and change one property
|
// Clone the object and change one property
|
||||||
// export const mockUploadConfigResponseNotRequired = JSON.parse(JSON.stringify(mockUploadConfigResponse));
|
export const mockUploadConfigResponseNotRequired = JSON.parse(JSON.stringify(mockUploadConfigResponse));
|
||||||
// mockUploadConfigResponseNotRequired.required = false;
|
mockUploadConfigResponseNotRequired.required = false;
|
||||||
|
|
||||||
export const mockAccessConditionOptions = [
|
export const mockAccessConditionOptions = [
|
||||||
{
|
{
|
||||||
|
@@ -273,7 +273,7 @@ describe('SubmissionSectionUploadComponent test suite', () => {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should properly read the section status', () => {
|
it('should properly read the section status when required is true', () => {
|
||||||
submissionServiceStub.getSubmissionObject.and.returnValue(observableOf(submissionState));
|
submissionServiceStub.getSubmissionObject.and.returnValue(observableOf(submissionState));
|
||||||
|
|
||||||
collectionDataService.findById.and.returnValue(createSuccessfulRemoteDataObject$(mockCollection));
|
collectionDataService.findById.and.returnValue(createSuccessfulRemoteDataObject$(mockCollection));
|
||||||
|
Reference in New Issue
Block a user