Add integration tests to viewer role

This commit is contained in:
Pablo Alba 2024-11-15 17:47:28 +01:00
parent df416af19b
commit 3a7d187110
10 changed files with 236 additions and 2 deletions

View file

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