Fix: use original object for children in tag list (#11127)

This commit is contained in:
shamoon 2025-10-22 09:42:39 -07:00 committed by GitHub
parent 78893292f8
commit 31cee7481b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 19 additions and 1 deletions

View file

@ -347,4 +347,18 @@ describe('ManagementListComponent', () => {
expect(component.userCanBulkEdit(PermissionAction.Delete)).toBeFalsy()
expect(component.userCanBulkEdit(PermissionAction.Change)).toBeFalsy()
})
it('should return an original object from filtered child object', () => {
const childTag: Tag = {
id: 4,
name: 'Child Tag',
matching_algorithm: MATCH_LITERAL,
match: 'child',
document_count: 10,
parent: 1,
}
component['unfilteredData'].push(childTag)
const original = component.getOriginalObject({ id: 4 } as Tag)
expect(original).toEqual(childTag)
})
})