mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-08-01 08:32:18 +00:00
Fix: ensure create dialog uses correct attribute type (#13221)
This commit is contained in:
+24
-1
@@ -18,6 +18,7 @@ import {
|
||||
DocumentAttributesComponent,
|
||||
DocumentAttributesSectionKind,
|
||||
} from './document-attributes.component'
|
||||
import { ManagementListComponent } from './management-list/management-list.component'
|
||||
|
||||
@Component({
|
||||
selector: 'pngx-dummy-section',
|
||||
@@ -170,10 +171,32 @@ describe('DocumentAttributesComponent', () => {
|
||||
expect(component.activeManagementList).toBeNull()
|
||||
|
||||
component.activeNavID.set(1)
|
||||
const managementList = Object.create(ManagementListComponent.prototype)
|
||||
component.activeOutlet = {
|
||||
componentInstance: managementList,
|
||||
} as any
|
||||
expect(component.activeSection.kind).toBe(
|
||||
DocumentAttributesSectionKind.ManagementList
|
||||
)
|
||||
expect(component.activeManagementList).toBeDefined()
|
||||
expect(component.activeManagementList).toBe(managementList)
|
||||
})
|
||||
|
||||
it('should use the current component instance when the outlet is reused', () => {
|
||||
jest.spyOn(permissionsService, 'currentUserCan').mockReturnValue(true)
|
||||
component.activeNavID.set(1)
|
||||
const firstManagementList = Object.create(ManagementListComponent.prototype)
|
||||
const secondManagementList = Object.create(
|
||||
ManagementListComponent.prototype
|
||||
)
|
||||
component.activeOutlet = {
|
||||
componentInstance: firstManagementList,
|
||||
} as any
|
||||
|
||||
expect(component.activeManagementList).toBe(firstManagementList)
|
||||
|
||||
component.activeOutlet.componentInstance = secondManagementList
|
||||
|
||||
expect(component.activeManagementList).toBe(secondManagementList)
|
||||
})
|
||||
|
||||
it('should return activeCustomFields correctly', () => {
|
||||
|
||||
Reference in New Issue
Block a user