From 1bb4682975265c4be3257f71ad694378c44b8a4b Mon Sep 17 00:00:00 2001 From: Alexandre Rousseau Date: Fri, 20 Dec 2024 15:44:41 +0100 Subject: [PATCH] fix(ui): fix unit test - WF-148 --- src/ui/src/builder/builderManager.spec.ts | 18 +++++++++++++++--- .../workflows/base/WorkflowMiniMap.vue | 2 +- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/ui/src/builder/builderManager.spec.ts b/src/ui/src/builder/builderManager.spec.ts index 8e70cab4..8b30d4d9 100644 --- a/src/ui/src/builder/builderManager.spec.ts +++ b/src/ui/src/builder/builderManager.spec.ts @@ -59,18 +59,30 @@ describe(generateBuilderManager.name, () => { selectionStatus, } = generateBuilderManager(); - handleSelectionFromEvent({ ctrlKey: true } as KeyboardEvent, "1"); + handleSelectionFromEvent( + { ctrlKey: true } as KeyboardEvent, + "1", + "path", + ); expect(selectionStatus.value).toBe(SelectionStatus.Single); expect(isComponentIdSelected("1")).toBeTruthy(); - handleSelectionFromEvent({ ctrlKey: true } as KeyboardEvent, "2"); + handleSelectionFromEvent( + { ctrlKey: true } as KeyboardEvent, + "2", + "path", + ); expect(selectionStatus.value).toBe(SelectionStatus.Multiple); expect(isComponentIdSelected("1")).toBeTruthy(); expect(isComponentIdSelected("2")).toBeTruthy(); - handleSelectionFromEvent({ ctrlKey: true } as KeyboardEvent, "2"); + handleSelectionFromEvent( + { ctrlKey: true } as KeyboardEvent, + "2", + "path", + ); expect(selectionStatus.value).toBe(SelectionStatus.Single); expect(isComponentIdSelected("1")).toBeTruthy(); diff --git a/src/ui/src/components/workflows/base/WorkflowMiniMap.vue b/src/ui/src/components/workflows/base/WorkflowMiniMap.vue index 19bc0b3f..5cccd837 100644 --- a/src/ui/src/components/workflows/base/WorkflowMiniMap.vue +++ b/src/ui/src/components/workflows/base/WorkflowMiniMap.vue @@ -29,7 +29,7 @@ v-for="miniNode in miniNodes" :key="miniNode.id" class="node" - :class="{ selected: wfbm.firstSelectedId == miniNode.id }" + :class="{ selected: wfbm.isComponentIdSelected(miniNode.id) }" :style="{ top: `${miniNode.top * scale}px`, left: `${miniNode.left * scale}px`,