From ceb90cd9e0d7a0eb9f73f29865f70f22aa0fdff4 Mon Sep 17 00:00:00 2001 From: Alonso Torres Date: Wed, 12 Feb 2025 14:34:05 +0100 Subject: [PATCH] :bug: Fix problem with dashboard multiple selection (#5836) --- .../playwright/ui/specs/dashboard.spec.js | 27 +++++++++++++++++++ frontend/src/app/main/ui/dashboard/grid.cljs | 2 +- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/frontend/playwright/ui/specs/dashboard.spec.js b/frontend/playwright/ui/specs/dashboard.spec.js index 3352149f5..aa734d54d 100644 --- a/frontend/playwright/ui/specs/dashboard.spec.js +++ b/frontend/playwright/ui/specs/dashboard.spec.js @@ -84,6 +84,33 @@ test("User has context menu options for edit file", async ({ page }) => { await expect(dashboardPage.page.getByText("delete")).toBeVisible(); }); +test("Multiple elements in context", async ({ page }) => { + await DashboardPage.mockRPC( + page, + "get-all-projects", + "dashboard/get-all-projects.json", + ); + + const dashboardPage = new DashboardPage(page); + await dashboardPage.setupDrafts(); + await dashboardPage.goToDrafts(); + + const button = dashboardPage.page.getByRole("button", { name: /New File 1/ }); + await button.click(); + + const button2 = dashboardPage.page.getByRole("button", { + name: /New File 2/, + }); + await button2.click({ modifiers: ["Shift"] }); + + await button.click({ button: "right" }); + + await expect(button.getByTestId("duplicate-multi")).toBeVisible(); + await expect(button.getByTestId("file-move-multi")).toBeVisible(); + await expect(button.getByTestId("file-binary-export-multi")).toBeVisible(); + await expect(button.getByTestId("file-delete-multi")).toBeVisible(); +}); + test("User has create file button", async ({ page }) => { const dashboardPage = new DashboardPage(page); await dashboardPage.setupDrafts(); diff --git a/frontend/src/app/main/ui/dashboard/grid.cljs b/frontend/src/app/main/ui/dashboard/grid.cljs index c5af23efd..5d8ed5a0e 100644 --- a/frontend/src/app/main/ui/dashboard/grid.cljs +++ b/frontend/src/app/main/ui/dashboard/grid.cljs @@ -333,7 +333,7 @@ on-context-menu (mf/use-fn - (mf/deps is-library-view) + (mf/deps on-menu-click is-library-view) (fn [event] (dom/stop-propagation event) (dom/prevent-default event)