mirror of
https://github.com/penpot/penpot.git
synced 2025-05-10 04:26:38 +02:00
🐛 Pass color format to css formatter (#5890)
* 🐛 Pass color format to css formatter * 📎 Use get method to retrieve format * 📎 Add UI test to check background color is correctly copied to clipboard when changing the format
This commit is contained in:
parent
44acd79081
commit
f3040fc10d
9 changed files with 84 additions and 19 deletions
|
@ -32,3 +32,41 @@ test("Bug 9042 - Measurement unit dropdowns for columns are cut off in grid layo
|
|||
await rowsContainer.getByText("FR").nth(2).click();
|
||||
await expect(rowsContainer.getByText("%")).toBeInViewport();
|
||||
});
|
||||
|
||||
test("[Taiga #9116] Copy CSS background color in the selected format in the INSPECT tab", async ({
|
||||
page,
|
||||
context,
|
||||
}) => {
|
||||
const workspacePage = new WorkspacePage(page);
|
||||
await workspacePage.setupEmptyFile(page);
|
||||
await workspacePage.goToWorkspace();
|
||||
|
||||
await workspacePage.rectShapeButton.click();
|
||||
await workspacePage.clickWithDragViewportAt(128, 128, 200, 100);
|
||||
await workspacePage.clickLeafLayer("Rectangle");
|
||||
|
||||
const inspectButton = workspacePage.page.getByRole("tab", {
|
||||
name: "Inspect",
|
||||
});
|
||||
await inspectButton.click();
|
||||
|
||||
const colorDropdown = workspacePage.page
|
||||
.getByRole("combobox")
|
||||
.getByText("HEX");
|
||||
await colorDropdown.click();
|
||||
|
||||
const rgbaFormatButton = workspacePage.page.getByRole("option", {
|
||||
name: "RGBA",
|
||||
});
|
||||
await rgbaFormatButton.click();
|
||||
|
||||
const copyColorButton = workspacePage.page.getByRole("button", {
|
||||
name: "Copy color",
|
||||
});
|
||||
await copyColorButton.click();
|
||||
|
||||
const rgbaColorText = await page.evaluate(() =>
|
||||
navigator.clipboard.readText(),
|
||||
);
|
||||
expect(rgbaColorText).toContain("background: rgba(");
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue