From 65bf55f610d9a29543738eff15459e16c1d267ea Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Wed, 11 Feb 2026 00:02:10 -0800 Subject: [PATCH] Move for sonar --- .../document-detail.component.spec.ts | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) 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()