Add integration test to check fills limit in UI

This commit is contained in:
Belén Albeza
2025-10-14 16:14:53 +02:00
parent e4a3fc3940
commit 204d0dfb9d
2 changed files with 164 additions and 0 deletions

View File

@@ -89,6 +89,38 @@ test.describe("Shape attributes", () => {
await expect(workspace.page.getByTestId("add-fill")).toBeDisabled();
});
test("Cannot add a new text fill when the limit has been reached", async ({
page,
}) => {
const workspace = new WorkspacePage(page);
await workspace.mockConfigFlags(["enable-feature-render-wasm"]);
await workspace.setupEmptyFile();
await workspace.mockRPC(
/get\-file\?/,
"design/get-file-text-fills-limit.json",
);
await workspace.goToWorkspace({
fileId: "b1ff3fdf-b491-812b-8006-f2ce3d29333a",
pageId: "b1ff3fdf-b491-812b-8006-f2ce3d29333b",
});
await workspace.clickLeafLayer("Lorem ipsum");
await expect(
workspace.page.getByRole("button", { name: "Remove color" }),
).toHaveCount(7);
await workspace.page.getByRole("button", { name: "Add fill" }).click();
await expect(
workspace.page.getByRole("button", { name: "Remove color" }),
).toHaveCount(8);
await expect(
workspace.page.getByRole("button", { name: "Add fill" }),
).toBeDisabled();
});
});
test.describe("Multiple shapes attributes", () => {