mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-08 10:34:15 +00:00
Fixed build error
This commit is contained in:
@@ -46,7 +46,7 @@ describe('ItemDeleteComponent', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
mockItemDataService = jasmine.createSpyObj('mockItemDataService', {
|
mockItemDataService = jasmine.createSpyObj('mockItemDataService', {
|
||||||
delete: observableOf(new RestResponse(true, '200'))
|
delete: observableOf(new RestResponse(true, 200, 'OK'))
|
||||||
});
|
});
|
||||||
|
|
||||||
routeStub = {
|
routeStub = {
|
||||||
@@ -74,8 +74,8 @@ describe('ItemDeleteComponent', () => {
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
successfulRestResponse = new RestResponse(true, '200');
|
successfulRestResponse = new RestResponse(true, 200, 'OK');
|
||||||
failRestResponse = new RestResponse(false, '500');
|
failRestResponse = new RestResponse(false, 500, 'Internal Server Error');
|
||||||
|
|
||||||
fixture = TestBed.createComponent(ItemDeleteComponent);
|
fixture = TestBed.createComponent(ItemDeleteComponent);
|
||||||
comp = fixture.componentInstance;
|
comp = fixture.componentInstance;
|
||||||
|
@@ -45,7 +45,7 @@ describe('ItemPrivateComponent', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
mockItemDataService = jasmine.createSpyObj('mockItemDataService', {
|
mockItemDataService = jasmine.createSpyObj('mockItemDataService', {
|
||||||
setDiscoverable: observableOf(new RestResponse(true, '200'))
|
setDiscoverable: observableOf(new RestResponse(true, 200, 'OK'))
|
||||||
});
|
});
|
||||||
|
|
||||||
routeStub = {
|
routeStub = {
|
||||||
@@ -73,8 +73,8 @@ describe('ItemPrivateComponent', () => {
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
successfulRestResponse = new RestResponse(true, '200');
|
successfulRestResponse = new RestResponse(true, 200, 'OK');
|
||||||
failRestResponse = new RestResponse(false, '500');
|
failRestResponse = new RestResponse(false, 500, 'Internal Server Error');
|
||||||
|
|
||||||
fixture = TestBed.createComponent(ItemPrivateComponent);
|
fixture = TestBed.createComponent(ItemPrivateComponent);
|
||||||
comp = fixture.componentInstance;
|
comp = fixture.componentInstance;
|
||||||
|
@@ -45,7 +45,7 @@ describe('ItemReinstateComponent', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
mockItemDataService = jasmine.createSpyObj('mockItemDataService', {
|
mockItemDataService = jasmine.createSpyObj('mockItemDataService', {
|
||||||
setWithDrawn: observableOf(new RestResponse(true, '200'))
|
setWithDrawn: observableOf(new RestResponse(true, 200, 'OK'))
|
||||||
});
|
});
|
||||||
|
|
||||||
routeStub = {
|
routeStub = {
|
||||||
@@ -73,8 +73,8 @@ describe('ItemReinstateComponent', () => {
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
successfulRestResponse = new RestResponse(true, '200');
|
successfulRestResponse = new RestResponse(true, 200, 'OK');
|
||||||
failRestResponse = new RestResponse(false, '500');
|
failRestResponse = new RestResponse(false, 500, 'Internal Server Error');
|
||||||
|
|
||||||
fixture = TestBed.createComponent(ItemReinstateComponent);
|
fixture = TestBed.createComponent(ItemReinstateComponent);
|
||||||
comp = fixture.componentInstance;
|
comp = fixture.componentInstance;
|
||||||
|
@@ -45,7 +45,7 @@ describe('ItemWithdrawComponent', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
mockItemDataService = jasmine.createSpyObj('mockItemDataService', {
|
mockItemDataService = jasmine.createSpyObj('mockItemDataService', {
|
||||||
setWithDrawn: observableOf(new RestResponse(true, '200'))
|
setWithDrawn: observableOf(new RestResponse(true, 200, 'OK'))
|
||||||
});
|
});
|
||||||
|
|
||||||
routeStub = {
|
routeStub = {
|
||||||
@@ -73,8 +73,8 @@ describe('ItemWithdrawComponent', () => {
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
successfulRestResponse = new RestResponse(true, '200');
|
successfulRestResponse = new RestResponse(true, 200, 'OK');
|
||||||
failRestResponse = new RestResponse(false, '500');
|
failRestResponse = new RestResponse(false, 500, 'Internal Server Error');
|
||||||
|
|
||||||
fixture = TestBed.createComponent(ItemWithdrawComponent);
|
fixture = TestBed.createComponent(ItemWithdrawComponent);
|
||||||
comp = fixture.componentInstance;
|
comp = fixture.componentInstance;
|
||||||
|
@@ -28,7 +28,7 @@ describe('ItemDataService', () => {
|
|||||||
const responseCache = {
|
const responseCache = {
|
||||||
get(href: string) {
|
get(href: string) {
|
||||||
const responseCacheEntry = new ResponseCacheEntry();
|
const responseCacheEntry = new ResponseCacheEntry();
|
||||||
responseCacheEntry.response = new RestResponse(true, '200');
|
responseCacheEntry.response = new RestResponse(true, 200, 'OK');
|
||||||
return observableOf(responseCacheEntry);
|
return observableOf(responseCacheEntry);
|
||||||
}
|
}
|
||||||
} as ResponseCacheService;
|
} as ResponseCacheService;
|
||||||
@@ -121,7 +121,7 @@ describe('ItemDataService', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should setWithDrawn', () => {
|
it('should setWithDrawn', () => {
|
||||||
const expected = new RestResponse(true, '200');
|
const expected = new RestResponse(true, 200, 'OK');
|
||||||
const result = service.setWithDrawn(scopeID, true);
|
const result = service.setWithDrawn(scopeID, true);
|
||||||
result.subscribe((v) => expect(v).toEqual(expected));
|
result.subscribe((v) => expect(v).toEqual(expected));
|
||||||
|
|
||||||
@@ -143,7 +143,7 @@ describe('ItemDataService', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should setDiscoverable', () => {
|
it('should setDiscoverable', () => {
|
||||||
const expected = new RestResponse(true, '200');
|
const expected = new RestResponse(true, 200, 'OK');
|
||||||
const result = service.setDiscoverable(scopeID, false);
|
const result = service.setDiscoverable(scopeID, false);
|
||||||
result.subscribe((v) => expect(v).toEqual(expected));
|
result.subscribe((v) => expect(v).toEqual(expected));
|
||||||
|
|
||||||
@@ -164,7 +164,7 @@ describe('ItemDataService', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should delete the item', () => {
|
it('should delete the item', () => {
|
||||||
const expected = new RestResponse(true, '200');
|
const expected = new RestResponse(true, 200, 'OK');
|
||||||
const result = service.delete(scopeID);
|
const result = service.delete(scopeID);
|
||||||
result.subscribe((v) => expect(v).toEqual(expected));
|
result.subscribe((v) => expect(v).toEqual(expected));
|
||||||
|
|
||||||
|
@@ -1018,7 +1018,7 @@ export const mockSubmissionDefinition: SubmissionDefinitionsModel = {
|
|||||||
self: 'https://rest.api/dspace-spring-rest/api/config/submissiondefinitions/traditional'
|
self: 'https://rest.api/dspace-spring-rest/api/config/submissiondefinitions/traditional'
|
||||||
} as any;
|
} as any;
|
||||||
|
|
||||||
export const mockSubmissionState: SubmissionObjectState = {
|
export const mockSubmissionState: SubmissionObjectState = Object.assign({}, {
|
||||||
826: {
|
826: {
|
||||||
collection: mockSubmissionCollectionId,
|
collection: mockSubmissionCollectionId,
|
||||||
definition: 'traditional',
|
definition: 'traditional',
|
||||||
@@ -1114,9 +1114,9 @@ export const mockSubmissionState: SubmissionObjectState = {
|
|||||||
savePending: false,
|
savePending: false,
|
||||||
depositPending: false
|
depositPending: false
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
|
|
||||||
export const mockSectionsState = {
|
export const mockSectionsState = Object.assign({}, {
|
||||||
extraction: {
|
extraction: {
|
||||||
config: '',
|
config: '',
|
||||||
mandatory: true,
|
mandatory: true,
|
||||||
@@ -1199,7 +1199,7 @@ export const mockSectionsState = {
|
|||||||
isLoading: false,
|
isLoading: false,
|
||||||
isValid: false
|
isValid: false
|
||||||
} as any
|
} as any
|
||||||
};
|
});
|
||||||
|
|
||||||
export const mockSectionsList = [
|
export const mockSectionsList = [
|
||||||
{
|
{
|
||||||
|
@@ -33,7 +33,7 @@ describe('SubmissionFormComponent Component', () => {
|
|||||||
const collectionId = mockSubmissionCollectionId;
|
const collectionId = mockSubmissionCollectionId;
|
||||||
const submissionObjectNew: any = mockSubmissionObjectNew;
|
const submissionObjectNew: any = mockSubmissionObjectNew;
|
||||||
const submissionDefinition: any = mockSubmissionDefinition;
|
const submissionDefinition: any = mockSubmissionDefinition;
|
||||||
const submissionState: any = mockSubmissionState;
|
const submissionState: any = Object.assign({}, mockSubmissionState);
|
||||||
const selfUrl: any = mockSubmissionSelfUrl;
|
const selfUrl: any = mockSubmissionSelfUrl;
|
||||||
const sectionsList: any = mockSectionsList;
|
const sectionsList: any = mockSectionsList;
|
||||||
const sectionsData: any = mockSectionsData;
|
const sectionsData: any = mockSectionsData;
|
||||||
|
@@ -61,6 +61,7 @@ describe('SubmissionObjectEffects test suite', () => {
|
|||||||
const submissionDefinitionResponse: any = mockSubmissionDefinitionResponse;
|
const submissionDefinitionResponse: any = mockSubmissionDefinitionResponse;
|
||||||
const submissionDefinition: any = mockSubmissionDefinition;
|
const submissionDefinition: any = mockSubmissionDefinition;
|
||||||
const selfUrl: string = mockSubmissionSelfUrl;
|
const selfUrl: string = mockSubmissionSelfUrl;
|
||||||
|
const submissionState: any = Object.assign({}, mockSubmissionState);
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
@@ -267,7 +268,7 @@ describe('SubmissionObjectEffects test suite', () => {
|
|||||||
it('should return a UPLOAD_SECTION_DATA action for each updated section', () => {
|
it('should return a UPLOAD_SECTION_DATA action for each updated section', () => {
|
||||||
store.nextState({
|
store.nextState({
|
||||||
submission: {
|
submission: {
|
||||||
objects: mockSubmissionState
|
objects: submissionState
|
||||||
}
|
}
|
||||||
} as any);
|
} as any);
|
||||||
|
|
||||||
@@ -315,7 +316,7 @@ describe('SubmissionObjectEffects test suite', () => {
|
|||||||
it('should display a success notification', () => {
|
it('should display a success notification', () => {
|
||||||
store.nextState({
|
store.nextState({
|
||||||
submission: {
|
submission: {
|
||||||
objects: mockSubmissionState
|
objects: submissionState
|
||||||
}
|
}
|
||||||
} as any);
|
} as any);
|
||||||
|
|
||||||
@@ -360,7 +361,7 @@ describe('SubmissionObjectEffects test suite', () => {
|
|||||||
it('should display a warning notification when there are errors', () => {
|
it('should display a warning notification when there are errors', () => {
|
||||||
store.nextState({
|
store.nextState({
|
||||||
submission: {
|
submission: {
|
||||||
objects: mockSubmissionState
|
objects: submissionState
|
||||||
}
|
}
|
||||||
} as any);
|
} as any);
|
||||||
|
|
||||||
@@ -407,7 +408,7 @@ describe('SubmissionObjectEffects test suite', () => {
|
|||||||
it('should detect and notify a new section', () => {
|
it('should detect and notify a new section', () => {
|
||||||
store.nextState({
|
store.nextState({
|
||||||
submission: {
|
submission: {
|
||||||
objects: mockSubmissionState
|
objects: submissionState
|
||||||
}
|
}
|
||||||
} as any);
|
} as any);
|
||||||
|
|
||||||
@@ -534,7 +535,7 @@ describe('SubmissionObjectEffects test suite', () => {
|
|||||||
it('should not allow to deposit when there are errors', () => {
|
it('should not allow to deposit when there are errors', () => {
|
||||||
store.nextState({
|
store.nextState({
|
||||||
submission: {
|
submission: {
|
||||||
objects: mockSubmissionState
|
objects: submissionState
|
||||||
}
|
}
|
||||||
} as any);
|
} as any);
|
||||||
|
|
||||||
@@ -608,7 +609,7 @@ describe('SubmissionObjectEffects test suite', () => {
|
|||||||
it('should return a DEPOSIT_SUBMISSION_SUCCESS action on success', () => {
|
it('should return a DEPOSIT_SUBMISSION_SUCCESS action on success', () => {
|
||||||
store.nextState({
|
store.nextState({
|
||||||
submission: {
|
submission: {
|
||||||
objects: mockSubmissionState
|
objects: submissionState
|
||||||
}
|
}
|
||||||
} as any);
|
} as any);
|
||||||
|
|
||||||
@@ -634,7 +635,7 @@ describe('SubmissionObjectEffects test suite', () => {
|
|||||||
it('should return a DEPOSIT_SUBMISSION_ERROR action on error', () => {
|
it('should return a DEPOSIT_SUBMISSION_ERROR action on error', () => {
|
||||||
store.nextState({
|
store.nextState({
|
||||||
submission: {
|
submission: {
|
||||||
objects: mockSubmissionState
|
objects: submissionState
|
||||||
}
|
}
|
||||||
} as any);
|
} as any);
|
||||||
|
|
||||||
@@ -718,7 +719,7 @@ describe('SubmissionObjectEffects test suite', () => {
|
|||||||
it('should return a DISCARD_SUBMISSION_SUCCESS action on success', () => {
|
it('should return a DISCARD_SUBMISSION_SUCCESS action on success', () => {
|
||||||
store.nextState({
|
store.nextState({
|
||||||
submission: {
|
submission: {
|
||||||
objects: mockSubmissionState
|
objects: submissionState
|
||||||
}
|
}
|
||||||
} as any);
|
} as any);
|
||||||
|
|
||||||
@@ -744,7 +745,7 @@ describe('SubmissionObjectEffects test suite', () => {
|
|||||||
it('should return a DISCARD_SUBMISSION_ERROR action on error', () => {
|
it('should return a DISCARD_SUBMISSION_ERROR action on error', () => {
|
||||||
store.nextState({
|
store.nextState({
|
||||||
submission: {
|
submission: {
|
||||||
objects: mockSubmissionState
|
objects: submissionState
|
||||||
}
|
}
|
||||||
} as any);
|
} as any);
|
||||||
|
|
||||||
|
@@ -44,7 +44,11 @@ describe('submissionReducer test suite', () => {
|
|||||||
const submissionDefinition = mockSubmissionDefinitionResponse;
|
const submissionDefinition = mockSubmissionDefinitionResponse;
|
||||||
const selfUrl = mockSubmissionSelfUrl;
|
const selfUrl = mockSubmissionSelfUrl;
|
||||||
|
|
||||||
const initState: SubmissionObjectState = mockSubmissionState;
|
let initState: any;
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
initState = Object.assign({}, mockSubmissionState);
|
||||||
|
});
|
||||||
|
|
||||||
it('should init submission state properly', () => {
|
it('should init submission state properly', () => {
|
||||||
const expectedState = {
|
const expectedState = {
|
||||||
@@ -164,6 +168,7 @@ describe('submissionReducer test suite', () => {
|
|||||||
depositPending: false
|
depositPending: false
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const action = new CompleteInitSubmissionFormAction(submissionId);
|
const action = new CompleteInitSubmissionFormAction(submissionId);
|
||||||
const newState = submissionObjectReducer(state, action);
|
const newState = submissionObjectReducer(state, action);
|
||||||
|
|
||||||
|
@@ -93,7 +93,7 @@ export class LicenseSectionComponent extends SectionModelComponent {
|
|||||||
take(1),
|
take(1),
|
||||||
filter((isReadOnly) => isReadOnly))
|
filter((isReadOnly) => isReadOnly))
|
||||||
.subscribe(() => {
|
.subscribe(() => {
|
||||||
model.disabled = true;
|
model.disabledUpdates.next(true);
|
||||||
});
|
});
|
||||||
this.changeDetectorRef.detectChanges();
|
this.changeDetectorRef.detectChanges();
|
||||||
}),
|
}),
|
||||||
|
@@ -41,7 +41,8 @@ describe('SectionsService test suite', () => {
|
|||||||
const sectionId = 'traditionalpageone';
|
const sectionId = 'traditionalpageone';
|
||||||
const sectionErrors: any = parseSectionErrors(mockSectionsErrors);
|
const sectionErrors: any = parseSectionErrors(mockSectionsErrors);
|
||||||
const sectionData: any = mockSectionsData;
|
const sectionData: any = mockSectionsData;
|
||||||
const sectionState: any = mockSubmissionState['826'].sections[sectionId];
|
const submissionState: any = Object.assign({}, mockSubmissionState[submissionId]);
|
||||||
|
const sectionState: any = Object.assign({}, mockSubmissionState['826'].sections[sectionId]);
|
||||||
|
|
||||||
const store: any = jasmine.createSpyObj('store', {
|
const store: any = jasmine.createSpyObj('store', {
|
||||||
dispatch: jasmine.createSpy('dispatch'),
|
dispatch: jasmine.createSpy('dispatch'),
|
||||||
@@ -283,7 +284,7 @@ describe('SectionsService test suite', () => {
|
|||||||
|
|
||||||
describe('isSectionAvailable', () => {
|
describe('isSectionAvailable', () => {
|
||||||
it('should return an observable of true when section is available', () => {
|
it('should return an observable of true when section is available', () => {
|
||||||
store.select.and.returnValue(observableOf(mockSubmissionState[submissionId]));
|
store.select.and.returnValue(observableOf(submissionState));
|
||||||
|
|
||||||
const expected = cold('(b|)', {
|
const expected = cold('(b|)', {
|
||||||
b: true
|
b: true
|
||||||
@@ -293,7 +294,7 @@ describe('SectionsService test suite', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should return an observable of false when section is not available', () => {
|
it('should return an observable of false when section is not available', () => {
|
||||||
store.select.and.returnValue(observableOf(mockSubmissionState[submissionId]));
|
store.select.and.returnValue(observableOf(submissionState));
|
||||||
|
|
||||||
const expected = cold('(b|)', {
|
const expected = cold('(b|)', {
|
||||||
b: false
|
b: false
|
||||||
|
@@ -85,7 +85,7 @@ describe('UploadSectionComponent test suite', () => {
|
|||||||
|
|
||||||
const submissionId = mockSubmissionId;
|
const submissionId = mockSubmissionId;
|
||||||
const collectionId = mockSubmissionCollectionId;
|
const collectionId = mockSubmissionCollectionId;
|
||||||
const submissionState = mockSubmissionState[mockSubmissionId];
|
const submissionState = Object.assign({}, mockSubmissionState[mockSubmissionId]);
|
||||||
const mockCollection = Object.assign(new Collection(), {
|
const mockCollection = Object.assign(new Collection(), {
|
||||||
name: 'Community 1-Collection 1',
|
name: 'Community 1-Collection 1',
|
||||||
id: collectionId,
|
id: collectionId,
|
||||||
@@ -217,7 +217,6 @@ describe('UploadSectionComponent test suite', () => {
|
|||||||
expect(compAsAny.fileList).toEqual([]);
|
expect(compAsAny.fileList).toEqual([]);
|
||||||
expect(compAsAny.fileIndexes).toEqual([]);
|
expect(compAsAny.fileIndexes).toEqual([]);
|
||||||
expect(compAsAny.fileNames).toEqual([]);
|
expect(compAsAny.fileNames).toEqual([]);
|
||||||
// this.fileIndexes, this.fileNames).toEqual(expectedGroupsMap);
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user