🐛 Update visual regression tests (#8730)

This commit is contained in:
Xaviju
2026-03-25 09:51:32 +01:00
committed by GitHub
parent caa25c70fc
commit a59bd05c4f
6 changed files with 17 additions and 5 deletions

1
.gitignore vendored
View File

@@ -50,6 +50,7 @@
/frontend/.storybook/preview-body.html
/frontend/.storybook/preview-head.html
/frontend/playwright-report/
/frontend/playwright/ui/visual-specs/
/frontend/text-editor/src/wasm/
/frontend/dist/
/frontend/npm-debug.log

View File

@@ -147,6 +147,7 @@ export class DashboardPage extends BaseWebSocketPage {
"get-projects?team-id=*",
"dashboard/get-projects-full.json",
);
await this.mockRPC(
"get-project-files?project-id=*",
"dashboard/get-project-files.json",

View File

@@ -9,6 +9,7 @@ test("User goes to an empty dashboard", async ({ page }) => {
const dashboardPage = new DashboardPage(page);
await dashboardPage.goToDashboard();
await expect(dashboardPage.page).toHaveURL(/dashboard/);
await expect(dashboardPage.mainHeading).toBeVisible();
await expect(dashboardPage.page).toHaveScreenshot();
@@ -122,9 +123,7 @@ test("User goes to a full search page", async ({ page }) => {
await dashboardPage.searchInput.fill("3");
await expect(dashboardPage.mainHeading).toHaveText("Search results");
await expect(
dashboardPage.page.getByRole("button", { name: "New File 3" }),
).toBeVisible();
await expect(page.getByRole("button", { name: "New File 3" })).toBeVisible();
await expect(dashboardPage.page).toHaveScreenshot();
});
@@ -202,6 +201,10 @@ test("User opens teams selector with more than one team", async ({ page }) => {
test("User goes to second team", async ({ page }) => {
const dashboardPage = new DashboardPage(page);
await dashboardPage.setupDashboardFull();
await dashboardPage.mockRPC(
`get-projects?team-id=${DashboardPage.secondTeamId}`,
"dashboard/get-projects-second-team.json",
);
await dashboardPage.goToDashboard();
await dashboardPage.teamDropdown.click();
@@ -216,6 +219,10 @@ test("User goes to second team", async ({ page }) => {
test("User opens team management dropdown", async ({ page }) => {
const dashboardPage = new DashboardPage(page);
await dashboardPage.setupDashboardFull();
await dashboardPage.mockRPC(
`get-projects?team-id=${DashboardPage.secondTeamId}`,
"dashboard/get-projects-second-team.json",
);
await dashboardPage.goToSecondTeamDashboard();
await expect(page.getByText("Team Up")).toBeVisible();

View File

@@ -103,7 +103,7 @@ test("User goes to the Viewer Inspect code", async ({ page }) => {
await expect(
viewerPage.page.getByRole("button", {
name: "Toggle panel Size & Position",
name: "Toggle panel Size and position",
}),
).toBeVisible();

View File

@@ -158,7 +158,9 @@ test.describe("Palette", () => {
.getByRole("button", { name: "Color Palette" })
.click();
await expect(
workspace.palette.getByRole("button", { name: "#7798ff" }),
workspace.palette.getByText(
"There are no color styles in your library yet",
),
).toBeVisible();
});
});

View File

@@ -413,6 +413,7 @@
:ref node-ref
:role "button"
:title (:name file)
:aria-label (:name file)
:draggable (dm/str can-edit)
:on-click on-select
:on-key-down on-key-down