@@ -24,7 +24,7 @@ import {
2424 mockSubmissionState ,
2525 mockUploadConfigResponse ,
2626 mockUploadConfigResponseNotRequired ,
27- mockUploadFiles ,
27+ mockUploadFiles , mockUploadFilesData ,
2828} from '../../../shared/mocks/submission.mock' ;
2929import { SubmissionUploadsConfigDataService } from '../../../core/config/submission-uploads-config-data.service' ;
3030import { SectionUploadService } from './section-upload.service' ;
@@ -162,6 +162,7 @@ describe('SubmissionSectionUploadComponent test suite', () => {
162162 ) ;
163163
164164 bitstreamService . getUploadedFileList . and . returnValue ( observableOf ( [ ] ) ) ;
165+ bitstreamService . getUploadedFilesData . and . returnValue ( observableOf ( { primary : null , files : [ ] } ) ) ;
165166 } ;
166167
167168 TestBed . configureTestingModule ( {
@@ -232,7 +233,7 @@ describe('SubmissionSectionUploadComponent test suite', () => {
232233 } ) ;
233234
234235 it ( 'should init component properly' , ( ) => {
235-
236+ bitstreamService . getUploadedFilesData . and . returnValue ( observableOf ( { primary : null , files : [ ] } ) ) ;
236237 submissionServiceStub . getSubmissionObject . and . returnValue ( observableOf ( submissionState ) ) ;
237238
238239 collectionDataService . findById . and . returnValue ( createSuccessfulRemoteDataObject$ ( Object . assign ( new Collection ( ) , mockCollection , {
@@ -248,8 +249,6 @@ describe('SubmissionSectionUploadComponent test suite', () => {
248249 createSuccessfulRemoteDataObject$ ( Object . assign ( new Group ( ) , mockGroup ) )
249250 ) ;
250251
251- bitstreamService . getUploadedFileList . and . returnValue ( observableOf ( [ ] ) ) ;
252-
253252 comp . onSectionInit ( ) ;
254253
255254 const expectedGroupsMap = new Map ( [
@@ -271,6 +270,7 @@ describe('SubmissionSectionUploadComponent test suite', () => {
271270 } ) ;
272271
273272 it ( 'should init file list properly' , ( ) => {
273+ bitstreamService . getUploadedFilesData . and . returnValue ( observableOf ( { primary : null , files : [ ] } ) ) ;
274274
275275 submissionServiceStub . getSubmissionObject . and . returnValue ( observableOf ( submissionState ) ) ;
276276
@@ -285,7 +285,7 @@ describe('SubmissionSectionUploadComponent test suite', () => {
285285 createSuccessfulRemoteDataObject$ ( Object . assign ( new Group ( ) , mockGroup ) )
286286 ) ;
287287
288- bitstreamService . getUploadedFileList . and . returnValue ( observableOf ( mockUploadFiles ) ) ;
288+ bitstreamService . getUploadedFilesData . and . returnValue ( observableOf ( mockUploadFilesData ) ) ;
289289
290290 comp . onSectionInit ( ) ;
291291
@@ -308,6 +308,8 @@ describe('SubmissionSectionUploadComponent test suite', () => {
308308 } ) ;
309309
310310 it ( 'should properly read the section status when required is true' , ( ) => {
311+ bitstreamService . getUploadedFilesData . and . returnValue ( observableOf ( { primary : null , files : [ ] } ) ) ;
312+
311313 submissionServiceStub . getSubmissionObject . and . returnValue ( observableOf ( submissionState ) ) ;
312314
313315 sectionsServiceStub . getSectionErrors . and . returnValue ( observableOf ( [ ] ) ) ;
@@ -325,7 +327,7 @@ describe('SubmissionSectionUploadComponent test suite', () => {
325327
326328 bitstreamService . getUploadedFileList . and . returnValue ( cold ( '-a-b' , {
327329 a : [ ] ,
328- b : mockUploadFiles
330+ b : mockUploadFiles ,
329331 } ) ) ;
330332
331333 comp . onSectionInit ( ) ;
@@ -341,6 +343,8 @@ describe('SubmissionSectionUploadComponent test suite', () => {
341343 it ( 'should properly read the section status when required is false' , ( ) => {
342344 submissionServiceStub . getSubmissionObject . and . returnValue ( observableOf ( submissionState ) ) ;
343345
346+ bitstreamService . getUploadedFilesData . and . returnValue ( observableOf ( { primary : null , files : [ ] } ) ) ;
347+
344348 sectionsServiceStub . getSectionErrors . and . returnValue ( observableOf ( [ ] ) ) ;
345349
346350 collectionDataService . findById . and . returnValue ( createSuccessfulRemoteDataObject$ ( mockCollection ) ) ;
0 commit comments