mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-23 10:39:25 -05:00
Chore: add coverage for missing lines in patch change
This commit is contained in:
parent
af95963c5f
commit
5a278381e3
@ -992,6 +992,44 @@ describe('DocumentDetailComponent', () => {
|
||||
)
|
||||
})
|
||||
|
||||
it('should correctly determine changed fields', () => {
|
||||
initNormally()
|
||||
expect(component['getChangedFields']()).toEqual({
|
||||
id: doc.id,
|
||||
})
|
||||
component.documentForm.get('title').setValue('Foo Bar')
|
||||
component.documentForm.get('permissions_form').setValue({
|
||||
owner: 1,
|
||||
set_permissions: {
|
||||
view: {
|
||||
users: [2],
|
||||
groups: [],
|
||||
},
|
||||
change: {
|
||||
users: [3],
|
||||
groups: [],
|
||||
},
|
||||
},
|
||||
})
|
||||
component.documentForm.get('title').markAsDirty()
|
||||
component.documentForm.get('permissions_form').markAsDirty()
|
||||
expect(component['getChangedFields']()).toEqual({
|
||||
id: doc.id,
|
||||
title: 'Foo Bar',
|
||||
owner: 1,
|
||||
set_permissions: {
|
||||
view: {
|
||||
users: [2],
|
||||
groups: [],
|
||||
},
|
||||
change: {
|
||||
users: [3],
|
||||
groups: [],
|
||||
},
|
||||
},
|
||||
})
|
||||
})
|
||||
|
||||
it('should show custom field errors', () => {
|
||||
initNormally()
|
||||
component.error = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user