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 39925f2f9..28a0e8bc0 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 @@ -22,6 +22,7 @@ import { SwitchComponent } from '../../input/switch/switch.component' import { EditDialogMode } from '../edit-dialog.component' import { DOCUMENT_SOURCE_OPTIONS, + SCHEDULE_DATE_FIELD_OPTIONS, WORKFLOW_ACTION_OPTIONS, WORKFLOW_TYPE_OPTIONS, WorkflowEditDialogComponent, @@ -40,6 +41,7 @@ import { import { MATCHING_ALGORITHMS, MATCH_AUTO } from 'src/app/data/matching-model' import { ConfirmButtonComponent } from '../../confirm-button/confirm-button.component' import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' +import { CustomFieldDataType } from 'src/app/data/custom-field' const workflow: Workflow = { name: 'Workflow 1', @@ -148,7 +150,18 @@ describe('WorkflowEditDialogComponent', () => { useValue: { listAll: () => of({ - results: [], + results: [ + { + id: 1, + name: 'cf1', + data_type: CustomFieldDataType.String, + }, + { + id: 2, + name: 'cf2', + data_type: CustomFieldDataType.Date, + }, + ], }), }, }, @@ -186,7 +199,7 @@ describe('WorkflowEditDialogComponent', () => { expect(editTitleSpy).toHaveBeenCalled() }) - it('should return source options, type options, type name', () => { + it('should return source options, type options, type name, schedule date field options', () => { // coverage expect(component.sourceOptions).toEqual(DOCUMENT_SOURCE_OPTIONS) expect(component.triggerTypeOptions).toEqual(WORKFLOW_TYPE_OPTIONS) @@ -200,6 +213,9 @@ describe('WorkflowEditDialogComponent', () => { component.getActionTypeOptionName(WorkflowActionType.Assignment) ).toEqual('Assignment') expect(component.getActionTypeOptionName(null)).toEqual('') + expect(component.scheduleDateFieldOptions).toEqual( + SCHEDULE_DATE_FIELD_OPTIONS + ) }) it('should support add and remove triggers and actions', () => {