diff --git a/src/app/+item-page/edit-item-page/item-delete/item-delete.component.spec.ts b/src/app/+item-page/edit-item-page/item-delete/item-delete.component.spec.ts index 50c494128a..4b2cb2b7a5 100644 --- a/src/app/+item-page/edit-item-page/item-delete/item-delete.component.spec.ts +++ b/src/app/+item-page/edit-item-page/item-delete/item-delete.component.spec.ts @@ -46,7 +46,7 @@ describe('ItemDeleteComponent', () => { }); mockItemDataService = jasmine.createSpyObj('mockItemDataService', { - delete: observableOf(new RestResponse(true, '200')) + delete: observableOf(new RestResponse(true, 200, 'OK')) }); routeStub = { @@ -74,8 +74,8 @@ describe('ItemDeleteComponent', () => { })); beforeEach(() => { - successfulRestResponse = new RestResponse(true, '200'); - failRestResponse = new RestResponse(false, '500'); + successfulRestResponse = new RestResponse(true, 200, 'OK'); + failRestResponse = new RestResponse(false, 500, 'Internal Server Error'); fixture = TestBed.createComponent(ItemDeleteComponent); comp = fixture.componentInstance; diff --git a/src/app/+item-page/edit-item-page/item-private/item-private.component.spec.ts b/src/app/+item-page/edit-item-page/item-private/item-private.component.spec.ts index 5b99ced743..99b676255f 100644 --- a/src/app/+item-page/edit-item-page/item-private/item-private.component.spec.ts +++ b/src/app/+item-page/edit-item-page/item-private/item-private.component.spec.ts @@ -1,21 +1,21 @@ -import {async, ComponentFixture, TestBed} from '@angular/core/testing'; -import {Item} from '../../../core/shared/item.model'; -import {RouterStub} from '../../../shared/testing/router-stub'; -import {of as observableOf} from 'rxjs'; -import {RestResponse} from '../../../core/cache/response-cache.models'; -import {RemoteData} from '../../../core/data/remote-data'; -import {NotificationsServiceStub} from '../../../shared/testing/notifications-service-stub'; -import {CommonModule} from '@angular/common'; -import {FormsModule} from '@angular/forms'; -import {RouterTestingModule} from '@angular/router/testing'; -import {TranslateModule} from '@ngx-translate/core'; -import {NgbModule} from '@ng-bootstrap/ng-bootstrap'; -import {ActivatedRoute, Router} from '@angular/router'; -import {ItemDataService} from '../../../core/data/item-data.service'; -import {NotificationsService} from '../../../shared/notifications/notifications.service'; -import {CUSTOM_ELEMENTS_SCHEMA} from '@angular/core'; -import {By} from '@angular/platform-browser'; -import {ItemPrivateComponent} from './item-private.component'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { Item } from '../../../core/shared/item.model'; +import { RouterStub } from '../../../shared/testing/router-stub'; +import { of as observableOf } from 'rxjs'; +import { RestResponse } from '../../../core/cache/response-cache.models'; +import { RemoteData } from '../../../core/data/remote-data'; +import { NotificationsServiceStub } from '../../../shared/testing/notifications-service-stub'; +import { CommonModule } from '@angular/common'; +import { FormsModule } from '@angular/forms'; +import { RouterTestingModule } from '@angular/router/testing'; +import { TranslateModule } from '@ngx-translate/core'; +import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; +import { ActivatedRoute, Router } from '@angular/router'; +import { ItemDataService } from '../../../core/data/item-data.service'; +import { NotificationsService } from '../../../shared/notifications/notifications.service'; +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { By } from '@angular/platform-browser'; +import { ItemPrivateComponent } from './item-private.component'; let comp: ItemPrivateComponent; let fixture: ComponentFixture; @@ -44,8 +44,8 @@ describe('ItemPrivateComponent', () => { url: `${itemPageUrl}/edit` }); - mockItemDataService = jasmine.createSpyObj('mockItemDataService',{ - setDiscoverable: observableOf(new RestResponse(true, '200')) + mockItemDataService = jasmine.createSpyObj('mockItemDataService', { + setDiscoverable: observableOf(new RestResponse(true, 200, 'OK')) }); routeStub = { @@ -62,10 +62,10 @@ describe('ItemPrivateComponent', () => { imports: [CommonModule, FormsModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule.forRoot()], declarations: [ItemPrivateComponent], providers: [ - {provide: ActivatedRoute, useValue: routeStub}, - {provide: Router, useValue: routerStub}, - {provide: ItemDataService, useValue: mockItemDataService}, - {provide: NotificationsService, useValue: notificationsServiceStub}, + { provide: ActivatedRoute, useValue: routeStub }, + { provide: Router, useValue: routerStub }, + { provide: ItemDataService, useValue: mockItemDataService }, + { provide: NotificationsService, useValue: notificationsServiceStub }, ], schemas: [ CUSTOM_ELEMENTS_SCHEMA ] @@ -73,8 +73,8 @@ describe('ItemPrivateComponent', () => { })); beforeEach(() => { - successfulRestResponse = new RestResponse(true, '200'); - failRestResponse = new RestResponse(false, '500'); + successfulRestResponse = new RestResponse(true, 200, 'OK'); + failRestResponse = new RestResponse(false, 500, 'Internal Server Error'); fixture = TestBed.createComponent(ItemPrivateComponent); comp = fixture.componentInstance; diff --git a/src/app/+item-page/edit-item-page/item-reinstate/item-reinstate.component.spec.ts b/src/app/+item-page/edit-item-page/item-reinstate/item-reinstate.component.spec.ts index dbea7f3e69..e0c8c2550d 100644 --- a/src/app/+item-page/edit-item-page/item-reinstate/item-reinstate.component.spec.ts +++ b/src/app/+item-page/edit-item-page/item-reinstate/item-reinstate.component.spec.ts @@ -1,21 +1,21 @@ -import {async, ComponentFixture, TestBed} from '@angular/core/testing'; -import {Item} from '../../../core/shared/item.model'; -import {RouterStub} from '../../../shared/testing/router-stub'; -import {of as observableOf} from 'rxjs'; -import {RestResponse} from '../../../core/cache/response-cache.models'; -import {RemoteData} from '../../../core/data/remote-data'; -import {NotificationsServiceStub} from '../../../shared/testing/notifications-service-stub'; -import {CommonModule} from '@angular/common'; -import {FormsModule} from '@angular/forms'; -import {RouterTestingModule} from '@angular/router/testing'; -import {TranslateModule} from '@ngx-translate/core'; -import {NgbModule} from '@ng-bootstrap/ng-bootstrap'; -import {ActivatedRoute, Router} from '@angular/router'; -import {ItemDataService} from '../../../core/data/item-data.service'; -import {NotificationsService} from '../../../shared/notifications/notifications.service'; -import {CUSTOM_ELEMENTS_SCHEMA} from '@angular/core'; -import {By} from '@angular/platform-browser'; -import {ItemReinstateComponent} from './item-reinstate.component'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { Item } from '../../../core/shared/item.model'; +import { RouterStub } from '../../../shared/testing/router-stub'; +import { of as observableOf } from 'rxjs'; +import { RestResponse } from '../../../core/cache/response-cache.models'; +import { RemoteData } from '../../../core/data/remote-data'; +import { NotificationsServiceStub } from '../../../shared/testing/notifications-service-stub'; +import { CommonModule } from '@angular/common'; +import { FormsModule } from '@angular/forms'; +import { RouterTestingModule } from '@angular/router/testing'; +import { TranslateModule } from '@ngx-translate/core'; +import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; +import { ActivatedRoute, Router } from '@angular/router'; +import { ItemDataService } from '../../../core/data/item-data.service'; +import { NotificationsService } from '../../../shared/notifications/notifications.service'; +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { By } from '@angular/platform-browser'; +import { ItemReinstateComponent } from './item-reinstate.component'; let comp: ItemReinstateComponent; let fixture: ComponentFixture; @@ -44,8 +44,8 @@ describe('ItemReinstateComponent', () => { url: `${itemPageUrl}/edit` }); - mockItemDataService = jasmine.createSpyObj('mockItemDataService',{ - setWithDrawn: observableOf(new RestResponse(true, '200')) + mockItemDataService = jasmine.createSpyObj('mockItemDataService', { + setWithDrawn: observableOf(new RestResponse(true, 200, 'OK')) }); routeStub = { @@ -62,10 +62,10 @@ describe('ItemReinstateComponent', () => { imports: [CommonModule, FormsModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule.forRoot()], declarations: [ItemReinstateComponent], providers: [ - {provide: ActivatedRoute, useValue: routeStub}, - {provide: Router, useValue: routerStub}, - {provide: ItemDataService, useValue: mockItemDataService}, - {provide: NotificationsService, useValue: notificationsServiceStub}, + { provide: ActivatedRoute, useValue: routeStub }, + { provide: Router, useValue: routerStub }, + { provide: ItemDataService, useValue: mockItemDataService }, + { provide: NotificationsService, useValue: notificationsServiceStub }, ], schemas: [ CUSTOM_ELEMENTS_SCHEMA ] @@ -73,8 +73,8 @@ describe('ItemReinstateComponent', () => { })); beforeEach(() => { - successfulRestResponse = new RestResponse(true, '200'); - failRestResponse = new RestResponse(false, '500'); + successfulRestResponse = new RestResponse(true, 200, 'OK'); + failRestResponse = new RestResponse(false, 500, 'Internal Server Error'); fixture = TestBed.createComponent(ItemReinstateComponent); comp = fixture.componentInstance; diff --git a/src/app/+item-page/edit-item-page/item-status/item-status.component.spec.ts b/src/app/+item-page/edit-item-page/item-status/item-status.component.spec.ts index 319d4c47ae..f5aec6e287 100644 --- a/src/app/+item-page/edit-item-page/item-status/item-status.component.spec.ts +++ b/src/app/+item-page/edit-item-page/item-status/item-status.component.spec.ts @@ -10,7 +10,7 @@ import { Router } from '@angular/router'; import { RouterStub } from '../../../shared/testing/router-stub'; import { Item } from '../../../core/shared/item.model'; import { By } from '@angular/platform-browser'; -import {CUSTOM_ELEMENTS_SCHEMA} from '@angular/core'; +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; describe('ItemStatusComponent', () => { let comp: ItemStatusComponent; diff --git a/src/app/+item-page/edit-item-page/item-withdraw/item-withdraw.component.spec.ts b/src/app/+item-page/edit-item-page/item-withdraw/item-withdraw.component.spec.ts index e1de52a506..c3d98a1bbd 100644 --- a/src/app/+item-page/edit-item-page/item-withdraw/item-withdraw.component.spec.ts +++ b/src/app/+item-page/edit-item-page/item-withdraw/item-withdraw.component.spec.ts @@ -1,21 +1,21 @@ -import {async, ComponentFixture, TestBed} from '@angular/core/testing'; -import {Item} from '../../../core/shared/item.model'; -import {RouterStub} from '../../../shared/testing/router-stub'; -import {of as observableOf} from 'rxjs'; -import {RestResponse} from '../../../core/cache/response-cache.models'; -import {RemoteData} from '../../../core/data/remote-data'; -import {NotificationsServiceStub} from '../../../shared/testing/notifications-service-stub'; -import {CommonModule} from '@angular/common'; -import {FormsModule} from '@angular/forms'; -import {RouterTestingModule} from '@angular/router/testing'; -import {TranslateModule} from '@ngx-translate/core'; -import {NgbModule} from '@ng-bootstrap/ng-bootstrap'; -import {ActivatedRoute, Router} from '@angular/router'; -import {ItemDataService} from '../../../core/data/item-data.service'; -import {NotificationsService} from '../../../shared/notifications/notifications.service'; -import {CUSTOM_ELEMENTS_SCHEMA} from '@angular/core'; -import {ItemWithdrawComponent} from './item-withdraw.component'; -import {By} from '@angular/platform-browser'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { Item } from '../../../core/shared/item.model'; +import { RouterStub } from '../../../shared/testing/router-stub'; +import { of as observableOf } from 'rxjs'; +import { RestResponse } from '../../../core/cache/response-cache.models'; +import { RemoteData } from '../../../core/data/remote-data'; +import { NotificationsServiceStub } from '../../../shared/testing/notifications-service-stub'; +import { CommonModule } from '@angular/common'; +import { FormsModule } from '@angular/forms'; +import { RouterTestingModule } from '@angular/router/testing'; +import { TranslateModule } from '@ngx-translate/core'; +import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; +import { ActivatedRoute, Router } from '@angular/router'; +import { ItemDataService } from '../../../core/data/item-data.service'; +import { NotificationsService } from '../../../shared/notifications/notifications.service'; +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { ItemWithdrawComponent } from './item-withdraw.component'; +import { By } from '@angular/platform-browser'; let comp: ItemWithdrawComponent; let fixture: ComponentFixture; @@ -44,8 +44,8 @@ describe('ItemWithdrawComponent', () => { url: `${itemPageUrl}/edit` }); - mockItemDataService = jasmine.createSpyObj('mockItemDataService',{ - setWithDrawn: observableOf(new RestResponse(true, '200')) + mockItemDataService = jasmine.createSpyObj('mockItemDataService', { + setWithDrawn: observableOf(new RestResponse(true, 200, 'OK')) }); routeStub = { @@ -62,10 +62,10 @@ describe('ItemWithdrawComponent', () => { imports: [CommonModule, FormsModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule.forRoot(),], declarations: [ItemWithdrawComponent], providers: [ - {provide: ActivatedRoute, useValue: routeStub}, - {provide: Router, useValue: routerStub}, - {provide: ItemDataService, useValue: mockItemDataService}, - {provide: NotificationsService, useValue: notificationsServiceStub}, + { provide: ActivatedRoute, useValue: routeStub }, + { provide: Router, useValue: routerStub }, + { provide: ItemDataService, useValue: mockItemDataService }, + { provide: NotificationsService, useValue: notificationsServiceStub }, ], schemas: [ CUSTOM_ELEMENTS_SCHEMA ] @@ -73,8 +73,8 @@ describe('ItemWithdrawComponent', () => { })); beforeEach(() => { - successfulRestResponse = new RestResponse(true, '200'); - failRestResponse = new RestResponse(false, '500'); + successfulRestResponse = new RestResponse(true, 200, 'OK'); + failRestResponse = new RestResponse(false, 500, 'Internal Server Error'); fixture = TestBed.createComponent(ItemWithdrawComponent); comp = fixture.componentInstance; diff --git a/src/app/core/data/item-data.service.spec.ts b/src/app/core/data/item-data.service.spec.ts index f1ad737aa1..3e668ca1c3 100644 --- a/src/app/core/data/item-data.service.spec.ts +++ b/src/app/core/data/item-data.service.spec.ts @@ -28,7 +28,7 @@ describe('ItemDataService', () => { const responseCache = { get(href: string) { const responseCacheEntry = new ResponseCacheEntry(); - responseCacheEntry.response = new RestResponse(true, '200'); + responseCacheEntry.response = new RestResponse(true, 200, 'OK'); return observableOf(responseCacheEntry); } } as ResponseCacheService; @@ -121,7 +121,7 @@ describe('ItemDataService', () => { }); it('should setWithDrawn', () => { - const expected = new RestResponse(true, '200'); + const expected = new RestResponse(true, 200, 'OK'); const result = service.setWithDrawn(scopeID, true); result.subscribe((v) => expect(v).toEqual(expected)); @@ -143,7 +143,7 @@ describe('ItemDataService', () => { }); it('should setDiscoverable', () => { - const expected = new RestResponse(true, '200'); + const expected = new RestResponse(true, 200, 'OK'); const result = service.setDiscoverable(scopeID, false); result.subscribe((v) => expect(v).toEqual(expected)); @@ -164,7 +164,7 @@ describe('ItemDataService', () => { }); it('should delete the item', () => { - const expected = new RestResponse(true, '200'); + const expected = new RestResponse(true, 200, 'OK'); const result = service.delete(scopeID); result.subscribe((v) => expect(v).toEqual(expected)); diff --git a/src/app/shared/mocks/mock-submission.ts b/src/app/shared/mocks/mock-submission.ts index 88ebac5749..26f9c757ca 100644 --- a/src/app/shared/mocks/mock-submission.ts +++ b/src/app/shared/mocks/mock-submission.ts @@ -1018,7 +1018,7 @@ export const mockSubmissionDefinition: SubmissionDefinitionsModel = { self: 'https://rest.api/dspace-spring-rest/api/config/submissiondefinitions/traditional' } as any; -export const mockSubmissionState: SubmissionObjectState = { +export const mockSubmissionState: SubmissionObjectState = Object.assign({}, { 826: { collection: mockSubmissionCollectionId, definition: 'traditional', @@ -1114,9 +1114,9 @@ export const mockSubmissionState: SubmissionObjectState = { savePending: false, depositPending: false } -}; +}); -export const mockSectionsState = { +export const mockSectionsState = Object.assign({}, { extraction: { config: '', mandatory: true, @@ -1199,7 +1199,7 @@ export const mockSectionsState = { isLoading: false, isValid: false } as any -}; +}); export const mockSectionsList = [ { diff --git a/src/app/submission/form/submission-form.component.spec.ts b/src/app/submission/form/submission-form.component.spec.ts index dccb3adcea..bf29f50b05 100644 --- a/src/app/submission/form/submission-form.component.spec.ts +++ b/src/app/submission/form/submission-form.component.spec.ts @@ -33,7 +33,7 @@ describe('SubmissionFormComponent Component', () => { const collectionId = mockSubmissionCollectionId; const submissionObjectNew: any = mockSubmissionObjectNew; const submissionDefinition: any = mockSubmissionDefinition; - const submissionState: any = mockSubmissionState; + const submissionState: any = Object.assign({}, mockSubmissionState); const selfUrl: any = mockSubmissionSelfUrl; const sectionsList: any = mockSectionsList; const sectionsData: any = mockSectionsData; diff --git a/src/app/submission/objects/submission-objects.effects.spec.ts b/src/app/submission/objects/submission-objects.effects.spec.ts index b9c2cbdfb5..d773bef751 100644 --- a/src/app/submission/objects/submission-objects.effects.spec.ts +++ b/src/app/submission/objects/submission-objects.effects.spec.ts @@ -61,6 +61,7 @@ describe('SubmissionObjectEffects test suite', () => { const submissionDefinitionResponse: any = mockSubmissionDefinitionResponse; const submissionDefinition: any = mockSubmissionDefinition; const selfUrl: string = mockSubmissionSelfUrl; + const submissionState: any = Object.assign({}, mockSubmissionState); beforeEach(() => { TestBed.configureTestingModule({ @@ -267,7 +268,7 @@ describe('SubmissionObjectEffects test suite', () => { it('should return a UPLOAD_SECTION_DATA action for each updated section', () => { store.nextState({ submission: { - objects: mockSubmissionState + objects: submissionState } } as any); @@ -315,7 +316,7 @@ describe('SubmissionObjectEffects test suite', () => { it('should display a success notification', () => { store.nextState({ submission: { - objects: mockSubmissionState + objects: submissionState } } as any); @@ -360,7 +361,7 @@ describe('SubmissionObjectEffects test suite', () => { it('should display a warning notification when there are errors', () => { store.nextState({ submission: { - objects: mockSubmissionState + objects: submissionState } } as any); @@ -407,7 +408,7 @@ describe('SubmissionObjectEffects test suite', () => { it('should detect and notify a new section', () => { store.nextState({ submission: { - objects: mockSubmissionState + objects: submissionState } } as any); @@ -534,7 +535,7 @@ describe('SubmissionObjectEffects test suite', () => { it('should not allow to deposit when there are errors', () => { store.nextState({ submission: { - objects: mockSubmissionState + objects: submissionState } } as any); @@ -608,7 +609,7 @@ describe('SubmissionObjectEffects test suite', () => { it('should return a DEPOSIT_SUBMISSION_SUCCESS action on success', () => { store.nextState({ submission: { - objects: mockSubmissionState + objects: submissionState } } as any); @@ -634,7 +635,7 @@ describe('SubmissionObjectEffects test suite', () => { it('should return a DEPOSIT_SUBMISSION_ERROR action on error', () => { store.nextState({ submission: { - objects: mockSubmissionState + objects: submissionState } } as any); @@ -718,7 +719,7 @@ describe('SubmissionObjectEffects test suite', () => { it('should return a DISCARD_SUBMISSION_SUCCESS action on success', () => { store.nextState({ submission: { - objects: mockSubmissionState + objects: submissionState } } as any); @@ -744,7 +745,7 @@ describe('SubmissionObjectEffects test suite', () => { it('should return a DISCARD_SUBMISSION_ERROR action on error', () => { store.nextState({ submission: { - objects: mockSubmissionState + objects: submissionState } } as any); diff --git a/src/app/submission/objects/submission-objects.reducer.spec.ts b/src/app/submission/objects/submission-objects.reducer.spec.ts index 23307b3f69..a37d53c9aa 100644 --- a/src/app/submission/objects/submission-objects.reducer.spec.ts +++ b/src/app/submission/objects/submission-objects.reducer.spec.ts @@ -44,7 +44,11 @@ describe('submissionReducer test suite', () => { const submissionDefinition = mockSubmissionDefinitionResponse; const selfUrl = mockSubmissionSelfUrl; - const initState: SubmissionObjectState = mockSubmissionState; + let initState: any; + + beforeEach(() => { + initState = Object.assign({}, mockSubmissionState); + }); it('should init submission state properly', () => { const expectedState = { @@ -164,6 +168,7 @@ describe('submissionReducer test suite', () => { depositPending: false } }; + const action = new CompleteInitSubmissionFormAction(submissionId); const newState = submissionObjectReducer(state, action); diff --git a/src/app/submission/sections/license/section-license.component.ts b/src/app/submission/sections/license/section-license.component.ts index 55159b842d..5b63a59dbd 100644 --- a/src/app/submission/sections/license/section-license.component.ts +++ b/src/app/submission/sections/license/section-license.component.ts @@ -93,7 +93,7 @@ export class LicenseSectionComponent extends SectionModelComponent { take(1), filter((isReadOnly) => isReadOnly)) .subscribe(() => { - model.disabled = true; + model.disabledUpdates.next(true); }); this.changeDetectorRef.detectChanges(); }), diff --git a/src/app/submission/sections/sections.service.spec.ts b/src/app/submission/sections/sections.service.spec.ts index 45965e8776..4a1cea5972 100644 --- a/src/app/submission/sections/sections.service.spec.ts +++ b/src/app/submission/sections/sections.service.spec.ts @@ -41,7 +41,8 @@ describe('SectionsService test suite', () => { const sectionId = 'traditionalpageone'; const sectionErrors: any = parseSectionErrors(mockSectionsErrors); 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', { dispatch: jasmine.createSpy('dispatch'), @@ -283,7 +284,7 @@ describe('SectionsService test suite', () => { describe('isSectionAvailable', () => { 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|)', { b: true @@ -293,7 +294,7 @@ describe('SectionsService test suite', () => { }); 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|)', { b: false diff --git a/src/app/submission/sections/upload/section-upload.component.spec.ts b/src/app/submission/sections/upload/section-upload.component.spec.ts index 9ea3922226..1c64d673d3 100644 --- a/src/app/submission/sections/upload/section-upload.component.spec.ts +++ b/src/app/submission/sections/upload/section-upload.component.spec.ts @@ -85,7 +85,7 @@ describe('UploadSectionComponent test suite', () => { const submissionId = mockSubmissionId; const collectionId = mockSubmissionCollectionId; - const submissionState = mockSubmissionState[mockSubmissionId]; + const submissionState = Object.assign({}, mockSubmissionState[mockSubmissionId]); const mockCollection = Object.assign(new Collection(), { name: 'Community 1-Collection 1', id: collectionId, @@ -217,7 +217,6 @@ describe('UploadSectionComponent test suite', () => { expect(compAsAny.fileList).toEqual([]); expect(compAsAny.fileIndexes).toEqual([]); expect(compAsAny.fileNames).toEqual([]); - // this.fileIndexes, this.fileNames).toEqual(expectedGroupsMap); });