0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-23 07:16:07 -05:00

🎉 Add integration test for bug (#5875)

This commit is contained in:
Eva Marco 2025-02-17 16:29:28 +01:00 committed by GitHub
parent 83423a9509
commit 5e3b47e455
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 44 additions and 0 deletions

View file

@ -172,6 +172,48 @@ test("User adds a library and its automatically selected in the color palette",
).toBeVisible();
});
test("Bug 10179 - Drag & drop doesn't add colors to the Recent Colors palette", async ({
page,
}) => {
const workspacePage = new WorkspacePage(page);
await workspacePage.setupEmptyFile();
await workspacePage.goToWorkspace();
await workspacePage.page.keyboard.press("Alt+p");
await expect(
workspacePage.palette.getByText(
"There are no color styles in your library yet",
),
).toBeVisible();
await page.getByRole("button", { name: "#E8E9EA" }).click();
await expect(page.getByTestId("colorpicker")).toBeVisible();
const handler = await page.getByTestId("ramp-handler");
await expect(handler).toBeVisible();
const saturation_selection = await page.getByTestId(
"value-saturation-selector",
);
await expect(saturation_selection).toBeVisible();
const saturation_box = await saturation_selection.boundingBox();
const handler_box = await handler.boundingBox();
await page.mouse.move(
handler_box.x + handler_box.width,
handler_box.y + handler_box.height / 2,
);
await page.mouse.down();
await page.mouse.move(
saturation_box.x + saturation_box.width / 2,
saturation_box.y + saturation_box.height / 2,
);
await page.mouse.up();
await expect(
workspacePage.palette.getByText(
"There are no color styles in your library yet",
),
).not.toBeVisible();
});
test("Bug 7489 - Workspace-palette items stay hidden when opening with keyboard-shortcut", async ({
page,
}) => {

View file

@ -50,11 +50,13 @@
(calculate-pos event))))]
[:div {:class (stl/css :value-saturation-selector)
:data-testid "value-saturation-selector"
:on-pointer-down handle-start-drag
:on-pointer-up handle-stop-drag
:on-click calculate-pos
:on-pointer-move handle-change-pointer-move}
[:div {:class (stl/css :handler)
:data-testid "ramp-handler"
:style {:pointer-events "none"
:left (str (* 100 saturation) "%")
:top (str (* 100 (- 1 (/ value 255))) "%")}}]]))