From 1b8033209ac2409ee423382ecd6df22c0b26a908 Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Tue, 7 Oct 2025 14:04:20 -0700 Subject: [PATCH] 100% frontend coverage --- .../workflow-edit-dialog.component.spec.ts | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/src-ui/src/app/components/common/edit-dialog/workflow-edit-dialog/workflow-edit-dialog.component.spec.ts b/src-ui/src/app/components/common/edit-dialog/workflow-edit-dialog/workflow-edit-dialog.component.spec.ts index 43887b0eb..8c86f99b0 100644 --- a/src-ui/src/app/components/common/edit-dialog/workflow-edit-dialog/workflow-edit-dialog.component.spec.ts +++ b/src-ui/src/app/components/common/edit-dialog/workflow-edit-dialog/workflow-edit-dialog.component.spec.ts @@ -784,6 +784,26 @@ describe('WorkflowEditDialogComponent', () => { component.conditionDefinitions = originalDefinitions }) + it('should return empty select items when definition has unknown source', () => { + const originalDefinitions = component.conditionDefinitions + component.conditionDefinitions = [ + { + id: TriggerConditionType.CorrespondentIs, + name: 'Correspondent is', + inputType: 'select', + allowMultipleEntries: false, + allowMultipleValues: false, + selectItems: 'unknown', + } as any, + ] + + expect( + component.getConditionSelectItems(TriggerConditionType.CorrespondentIs) + ).toEqual([]) + + component.conditionDefinitions = originalDefinitions + }) + it('should handle custom field query selection change and validation states', () => { const formGroup = new FormGroup({ values: new FormControl(null), @@ -907,6 +927,21 @@ describe('WorkflowEditDialogComponent', () => { customFieldJson ) ).toEqual(customFieldJson) + + const customFieldObject = ['AND', [[1, 'exact', 'other']]] + expect( + component['normalizeConditionValue']( + TriggerConditionType.CustomFieldQuery, + customFieldObject + ) + ).toEqual(JSON.stringify(customFieldObject)) + + expect( + component['normalizeConditionValue']( + TriggerConditionType.CustomFieldQuery, + false + ) + ).toBeNull() }) it('should add and remove condition form groups', () => {