Skip to content

Commit 51f773d

Browse files
committed
fix test
1 parent f76d367 commit 51f773d

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

opencti-platform/opencti-front/src/private/components/settings/sub_types/workflow/hooks/useWorkflowForm.test.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { describe, it, expect, vi, beforeEach } from 'vitest';
33
import { Node, Edge } from 'reactflow';
44
import { FormikHelpers } from 'formik';
55
import { useWorkflowForm } from './useWorkflowForm'; // Adjust path
6-
import { WorkflowNodeType, WorkflowDataType, WorkflowActionType, Action, Condition, NEW_STATUS_NAME } from '../utils';
6+
import { WorkflowNodeType, WorkflowDataType, WorkflowActionType, Action, NEW_STATUS_NAME } from '../utils';
77
import { WorkflowEditionFormValues } from '../WorkflowEditionDrawer';
88

99
const mockSetNodes = vi.fn();
@@ -86,8 +86,14 @@ describe('useWorkflowForm', () => {
8686
result.current.onAddObject(WorkflowDataType.conditions, '', helpers.setFieldValue, mockValues);
8787
});
8888

89-
const expectedCondition: Condition = { field: '', operator: 'eq', value: '' };
90-
expect(helpers.setFieldValue).toHaveBeenCalledWith(WorkflowDataType.conditions, [expectedCondition]);
89+
expect(helpers.setFieldValue).toHaveBeenCalledWith(
90+
WorkflowDataType.conditions,
91+
expect.objectContaining({
92+
filterGroups: [],
93+
filters: [],
94+
mode: 'and',
95+
}),
96+
);
9197
});
9298

9399
it('should add a member update action with params', () => {

0 commit comments

Comments
 (0)