mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-10-25 00:58:56 +00:00
Fix: use signal-backed queries input in CF dropdown to reflect changes immediately under zoneless (#13901)
This commit is contained in:
1 parent
31e9f4272c
commit
38db6b51db
3 files changed
+51
-5
No files matched your search
@@ -1034,6 +1034,49 @@ describe('FilterEditorComponent', () => {
|
||||
).toEqual([42, CustomFieldQueryOperator.Exists, 'true'])
|
||||
})
|
||||
|
||||
it('should reflect ingested custom field query rules in the dropdown toggle', () => {
|
||||
const dropdown = fixture.debugElement.query(
|
||||
By.css('pngx-custom-fields-query-dropdown')
|
||||
)
|
||||
expect(
|
||||
dropdown.nativeElement.querySelector('pngx-clearable-badge')
|
||||
).toBeNull()
|
||||
|
||||
// switching to a view with a custom field query
|
||||
component.filterRules = [
|
||||
{
|
||||
rule_type: FILTER_CUSTOM_FIELDS_QUERY,
|
||||
value: '["OR",[[42,"exists","true"]]]',
|
||||
},
|
||||
]
|
||||
fixture.detectChanges()
|
||||
expect(
|
||||
dropdown.nativeElement.querySelector('pngx-clearable-badge')
|
||||
).not.toBeNull()
|
||||
expect(
|
||||
dropdown.nativeElement
|
||||
.querySelector('#dropdown_toggle')
|
||||
.classList.contains('btn-primary')
|
||||
).toBeTruthy()
|
||||
|
||||
// and back to a view without one
|
||||
component.filterRules = [
|
||||
{
|
||||
rule_type: FILTER_HAS_TAGS_ALL,
|
||||
value: '19',
|
||||
},
|
||||
]
|
||||
fixture.detectChanges()
|
||||
expect(
|
||||
dropdown.nativeElement.querySelector('pngx-clearable-badge')
|
||||
).toBeNull()
|
||||
expect(
|
||||
dropdown.nativeElement
|
||||
.querySelector('#dropdown_toggle')
|
||||
.classList.contains('btn-primary')
|
||||
).toBeFalsy()
|
||||
})
|
||||
|
||||
it('should ingest filter rules for owner', () => {
|
||||
expect(component.permissionsSelectionModel.ownerFilter).toEqual(
|
||||
OwnerFilterType.NONE
|
||||
|
||||
Reference in new issue
Block a user