mirror of
https://github.com/penpot/penpot.git
synced 2025-06-24 20:46:59 +02:00
✨ Add integration tests to viewer role
This commit is contained in:
parent
df416af19b
commit
3a7d187110
10 changed files with 236 additions and 2 deletions
|
@ -52,3 +52,47 @@ test("Lists files in the drafts page", async ({ page }) => {
|
|||
dashboardPage.page.getByRole("button", { name: /New File 2/ }),
|
||||
).toBeVisible();
|
||||
});
|
||||
|
||||
test("User hasn't an empty placeholder", async ({ page }) => {
|
||||
const dashboardPage = new DashboardPage(page);
|
||||
await dashboardPage.goToDashboard();
|
||||
await expect(
|
||||
dashboardPage.page.getByTestId("empty-placeholder"),
|
||||
).toBeHidden();
|
||||
});
|
||||
|
||||
test("User has context menu options for edit file", async ({ page }) => {
|
||||
await DashboardPage.mockRPC(
|
||||
page,
|
||||
"get-all-projects",
|
||||
"dashboard/get-all-projects.json",
|
||||
);
|
||||
|
||||
const dashboardPage = new DashboardPage(page);
|
||||
await dashboardPage.setupDrafts();
|
||||
await dashboardPage.goToDrafts();
|
||||
|
||||
const button = dashboardPage.page.getByRole("button", { name: /New File 2/ });
|
||||
await button.click();
|
||||
await button.click({ button: "right" });
|
||||
|
||||
await expect(dashboardPage.page.getByText("rename")).toBeVisible();
|
||||
await expect(dashboardPage.page.getByText("duplicate")).toBeVisible();
|
||||
await expect(
|
||||
dashboardPage.page.getByText("add as shared library"),
|
||||
).toBeVisible();
|
||||
await expect(dashboardPage.page.getByText("delete")).toBeVisible();
|
||||
});
|
||||
|
||||
test("User has create file button", async ({ page }) => {
|
||||
const dashboardPage = new DashboardPage(page);
|
||||
await dashboardPage.setupDrafts();
|
||||
await dashboardPage.goToDrafts();
|
||||
await expect(dashboardPage.page.getByText("+ New File")).toBeVisible();
|
||||
});
|
||||
|
||||
test("User has add font button", async ({ page }) => {
|
||||
const dashboardPage = new DashboardPage(page);
|
||||
await dashboardPage.goToFonts();
|
||||
await expect(dashboardPage.page.getByText("add custom font")).toBeVisible();
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue