Skip to content

Commit

Permalink
Expanded functionality tests for New Workflow and Workflow List compo…
Browse files Browse the repository at this point in the history
…nents.

Signed-off-by: saimedhi <[email protected]>
  • Loading branch information
saimedhi committed Sep 18, 2024
1 parent 65c5ea0 commit f143ed2
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions test/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ export function mockStore(...workflowSets: WorkflowInput[]) {
workflows: {
...INITIAL_WORKFLOWS_STATE,
workflows: workflowSets.reduce(
(acc: Record<string, Workflow>, { id, name, type }) => {
acc[id] = generateWorkflow(id, name, type);
return acc;
},
(acc, workflowInput) => ({
...acc,
[workflowInput.id]: generateWorkflow(workflowInput),
}),
{}
),
},
Expand All @@ -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),
};
}

Expand Down

0 comments on commit f143ed2

Please sign in to comment.