diff --git a/src-ui/src/app/components/document-detail/document-detail.component.spec.ts b/src-ui/src/app/components/document-detail/document-detail.component.spec.ts index b2dd26fa5..4cfdcdf38 100644 --- a/src-ui/src/app/components/document-detail/document-detail.component.spec.ts +++ b/src-ui/src/app/components/document-detail/document-detail.component.spec.ts @@ -131,6 +131,24 @@ const customFields = [ }, ] +function createFileInput(file?: File) { + const input = document.createElement('input') + input.type = 'file' + const files = file + ? ({ + 0: file, + length: 1, + item: () => file, + } as unknown as FileList) + : ({ + length: 0, + item: () => null, + } as unknown as FileList) + Object.defineProperty(input, 'files', { value: files }) + input.value = '' + return input +} + describe('DocumentDetailComponent', () => { let component: DocumentDetailComponent let fixture: ComponentFixture @@ -1729,24 +1747,6 @@ describe('DocumentDetailComponent', () => { fixture.detectChanges() } - function createFileInput(file?: File) { - const input = document.createElement('input') - input.type = 'file' - const files = file - ? ({ - 0: file, - length: 1, - item: () => file, - } as unknown as FileList) - : ({ - length: 0, - item: () => null, - } as unknown as FileList) - Object.defineProperty(input, 'files', { value: files }) - input.value = '' - return input - } - it('createDisabled should return true if the user does not have permission to add the specified data type', () => { currentUserCan = false expect(component.createDisabled(DataType.Correspondent)).toBeTruthy()