Skip to content

Commit e32d095

Browse files
committed
Fix mock for createDuplicateFileNameDetector in section-upload spec
The mock was returning only { detect: spy } but the component accesses updateFileNames, fileNamesSignal, hasUploadFilesErrorsSignal, getDuplicates, and getDuplicateFileNamesDisplay. This caused afterAll errors that crashed Chrome after test completion.
1 parent e9da433 commit e32d095

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/app/submission/sections/upload/section-upload.component.spec.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,13 @@ const mockDatashareSubmissionService = {
6161
isTotalUploadedFilesSizeExceeded: jasmine.createSpy('isTotalUploadedFilesSizeExceeded').and.returnValue(false),
6262
formatBytes: jasmine.createSpy('formatBytes').and.returnValue('0 Bytes'),
6363
getDuplicateFileNames: jasmine.createSpy('getDuplicateFileNames').and.returnValue([]),
64-
createDuplicateFileNameDetector: jasmine.createSpy('createDuplicateFileNameDetector').and.returnValue({ detect: jasmine.createSpy('detect') }),
64+
createDuplicateFileNameDetector: jasmine.createSpy('createDuplicateFileNameDetector').and.returnValue({
65+
fileNamesSignal: signal<string[]>([]),
66+
hasUploadFilesErrorsSignal: signal(false),
67+
updateFileNames: jasmine.createSpy('updateFileNames'),
68+
getDuplicates: jasmine.createSpy('getDuplicates').and.returnValue([]),
69+
getDuplicateFileNamesDisplay: jasmine.createSpy('getDuplicateFileNamesDisplay').and.returnValue(''),
70+
}),
6571
sendCannotSubmitNotification: jasmine.createSpy('sendCannotSubmitNotification'),
6672
};
6773

0 commit comments

Comments
 (0)