mirror of
https://github.com/penpot/penpot.git
synced 2025-02-23 15:26:29 -05:00
🎉 Add integration test for bug (#5875)
This commit is contained in:
parent
83423a9509
commit
5e3b47e455
2 changed files with 44 additions and 0 deletions
|
@ -172,6 +172,48 @@ test("User adds a library and its automatically selected in the color palette",
|
||||||
).toBeVisible();
|
).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 ({
|
test("Bug 7489 - Workspace-palette items stay hidden when opening with keyboard-shortcut", async ({
|
||||||
page,
|
page,
|
||||||
}) => {
|
}) => {
|
||||||
|
|
|
@ -50,11 +50,13 @@
|
||||||
(calculate-pos event))))]
|
(calculate-pos event))))]
|
||||||
|
|
||||||
[:div {:class (stl/css :value-saturation-selector)
|
[:div {:class (stl/css :value-saturation-selector)
|
||||||
|
:data-testid "value-saturation-selector"
|
||||||
:on-pointer-down handle-start-drag
|
:on-pointer-down handle-start-drag
|
||||||
:on-pointer-up handle-stop-drag
|
:on-pointer-up handle-stop-drag
|
||||||
:on-click calculate-pos
|
:on-click calculate-pos
|
||||||
:on-pointer-move handle-change-pointer-move}
|
:on-pointer-move handle-change-pointer-move}
|
||||||
[:div {:class (stl/css :handler)
|
[:div {:class (stl/css :handler)
|
||||||
|
:data-testid "ramp-handler"
|
||||||
:style {:pointer-events "none"
|
:style {:pointer-events "none"
|
||||||
:left (str (* 100 saturation) "%")
|
:left (str (* 100 saturation) "%")
|
||||||
:top (str (* 100 (- 1 (/ value 255))) "%")}}]]))
|
:top (str (* 100 (- 1 (/ value 255))) "%")}}]]))
|
||||||
|
|
Loading…
Add table
Reference in a new issue