mirror of
https://github.com/penpot/penpot.git
synced 2025-05-09 22:26:37 +02:00
✨ Add e2e tests for fix color palette default library
This commit is contained in:
parent
d8184fb756
commit
edfc47d3de
10 changed files with 362 additions and 6 deletions
|
@ -38,3 +38,31 @@ test("User draws a rect", async ({ page }) => {
|
|||
await expect(shape).toHaveAttribute("width", "200");
|
||||
await expect(shape).toHaveAttribute("height", "100");
|
||||
});
|
||||
|
||||
test("User adds a library and its automatically selected in the color palette", async ({ page }) => {
|
||||
const workspacePage = new WorkspacePage(page);
|
||||
await workspacePage.setupEmptyFile();
|
||||
await workspacePage.mockRPC("link-file-to-library", "workspace/link-file-to-library.json");
|
||||
await workspacePage.mockRPC("unlink-file-from-library", "workspace/unlink-file-from-library.json");
|
||||
await workspacePage.mockRPC("get-team-shared-files?team-id=*", "workspace/get-team-shared-libraries-non-empty.json");
|
||||
|
||||
await workspacePage.goToWorkspace();
|
||||
|
||||
// Add Testing library 1
|
||||
await workspacePage.clickColorPalette();
|
||||
await workspacePage.clickAssets();
|
||||
// Now the get-file call should return a library
|
||||
await workspacePage.mockRPC(/get\-file\?/, "workspace/get-file-library.json");
|
||||
await workspacePage.clickLibraries();
|
||||
await workspacePage.clickLibrary("Testing library 1")
|
||||
await workspacePage.clickCloseLibraries();
|
||||
|
||||
await expect(workspacePage.palette.getByRole("button", { name: "test-color-187cd5" })).toBeVisible();
|
||||
|
||||
// Remove Testing library 1
|
||||
await workspacePage.clickLibraries();
|
||||
await workspacePage.clickLibrary("Testing library 1")
|
||||
await workspacePage.clickCloseLibraries();
|
||||
|
||||
await expect(workspacePage.palette.getByText('There are no color styles in your library yet')).toBeVisible();
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue