Skip to content

Commit

Permalink
fix(ui): fix unit test - WF-148
Browse files Browse the repository at this point in the history
  • Loading branch information
madeindjs committed Dec 20, 2024
1 parent f478b11 commit 1bb4682
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
18 changes: 15 additions & 3 deletions src/ui/src/builder/builderManager.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/ui/src/components/workflows/base/WorkflowMiniMap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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`,
Expand Down

0 comments on commit 1bb4682

Please sign in to comment.