Fix: global search filtering links broken in 2.8.4 (#6726)

This commit is contained in:
shamoon
2024-05-14 21:37:55 -07:00
committed by GitHub
parent 76ddc09dba
commit 2ac5407dd4
2 changed files with 26 additions and 22 deletions

View File

@@ -287,48 +287,44 @@ describe('GlobalSearchComponent', () => {
modalService.activeInstances.subscribe((m) => (modal = m[m.length - 1]))
component.primaryAction(DataType.Document, object)
expect(routerSpy).toHaveBeenCalledWith(['/documents', object.id])
expect(routerSpy).toHaveBeenCalledWith(['/documents', object.id], {})
component.primaryAction(DataType.SavedView, object)
expect(routerSpy).toHaveBeenCalledWith(['/view', object.id])
expect(routerSpy).toHaveBeenCalledWith(['/view', object.id], {})
component.primaryAction(DataType.Correspondent, object)
expect(routerSpy).toHaveBeenCalledWith([
'/documents',
queryParamsFromFilterRules([
expect(routerSpy).toHaveBeenCalledWith(['/documents'], {
queryParams: queryParamsFromFilterRules([
{
rule_type: FILTER_HAS_CORRESPONDENT_ANY,
value: object.id.toString(),
},
]),
])
})
component.primaryAction(DataType.DocumentType, object)
expect(routerSpy).toHaveBeenCalledWith([
'/documents',
queryParamsFromFilterRules([
expect(routerSpy).toHaveBeenCalledWith(['/documents'], {
queryParams: queryParamsFromFilterRules([
{
rule_type: FILTER_HAS_DOCUMENT_TYPE_ANY,
value: object.id.toString(),
},
]),
])
})
component.primaryAction(DataType.StoragePath, object)
expect(routerSpy).toHaveBeenCalledWith([
'/documents',
queryParamsFromFilterRules([
expect(routerSpy).toHaveBeenCalledWith(['/documents'], {
queryParams: queryParamsFromFilterRules([
{ rule_type: FILTER_HAS_STORAGE_PATH_ANY, value: object.id.toString() },
]),
])
})
component.primaryAction(DataType.Tag, object)
expect(routerSpy).toHaveBeenCalledWith([
'/documents',
queryParamsFromFilterRules([
expect(routerSpy).toHaveBeenCalledWith(['/documents'], {
queryParams: queryParamsFromFilterRules([
{ rule_type: FILTER_HAS_TAGS_ANY, value: object.id.toString() },
]),
])
})
component.primaryAction(DataType.User, object)
expect(modalSpy).toHaveBeenCalledWith(UserEditDialogComponent, {