From f143ed2dd8a5e7f5c7a3880518542f16906d9bbe Mon Sep 17 00:00:00 2001 From: saimedhi Date: Wed, 18 Sep 2024 16:42:23 -0700 Subject: [PATCH] Expanded functionality tests for New Workflow and Workflow List components. Signed-off-by: saimedhi --- test/utils.ts | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/test/utils.ts b/test/utils.ts index 3985b3ff..03d067de 100644 --- a/test/utils.ts +++ b/test/utils.ts @@ -29,10 +29,10 @@ export function mockStore(...workflowSets: WorkflowInput[]) { workflows: { ...INITIAL_WORKFLOWS_STATE, workflows: workflowSets.reduce( - (acc: Record, { id, name, type }) => { - acc[id] = generateWorkflow(id, name, type); - return acc; - }, + (acc, workflowInput) => ({ + ...acc, + [workflowInput.id]: generateWorkflow(workflowInput), + }), {} ), }, @@ -45,16 +45,12 @@ export function mockStore(...workflowSets: WorkflowInput[]) { }; } -function generateWorkflow( - workflowId: string, - workflowName: string, - workflowType: WORKFLOW_TYPE -): Workflow { +function generateWorkflow({ id, name, type }: WorkflowInput): Workflow { return { - id: workflowId, - name: workflowName, + id, + name, version: { template: '1.0.0', compatibility: ['2.17.0', '3.0.0'] }, - ui_metadata: getConfig(workflowType), + ui_metadata: getConfig(type), }; }