🐛 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:
Elena Torró 2025-02-19 11:23:52 +01:00 committed by GitHub
parent 44acd79081
commit f3040fc10d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 84 additions and 19 deletions

View file

@ -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(");
});