mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-02-11 23:59:31 -06:00
Move for sonar
This commit is contained in:
@@ -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', () => {
|
describe('DocumentDetailComponent', () => {
|
||||||
let component: DocumentDetailComponent
|
let component: DocumentDetailComponent
|
||||||
let fixture: ComponentFixture<DocumentDetailComponent>
|
let fixture: ComponentFixture<DocumentDetailComponent>
|
||||||
@@ -1729,24 +1747,6 @@ describe('DocumentDetailComponent', () => {
|
|||||||
fixture.detectChanges()
|
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', () => {
|
it('createDisabled should return true if the user does not have permission to add the specified data type', () => {
|
||||||
currentUserCan = false
|
currentUserCan = false
|
||||||
expect(component.createDisabled(DataType.Correspondent)).toBeTruthy()
|
expect(component.createDisabled(DataType.Correspondent)).toBeTruthy()
|
||||||
|
|||||||
Reference in New Issue
Block a user