mirror of
https://github.com/penpot/penpot.git
synced 2025-04-15 08:21:40 -05:00
🐛 Fix problem with dashboard multiple selection (#5836)
This commit is contained in:
parent
51f924a5e1
commit
ceb90cd9e0
2 changed files with 28 additions and 1 deletions
|
@ -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();
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue