38 lines
1.3 KiB
JavaScript

import { expect, test } from "../../../frontend/node_modules/@playwright/test/index.mjs";
test.beforeEach(async ({ page }) => {
await page.route("**/api/auth/config", async (route) => {
await route.fulfill({
status: 200,
contentType: "application/json",
body: JSON.stringify({ enabled: false }),
});
});
await page.route("**/api/lab/status", async (route) => {
await route.fulfill({
status: 200,
contentType: "application/json",
body: JSON.stringify({
connected: true,
atlas: { up: true },
oceanus: { up: false },
}),
});
});
});
test("shows the overview and expands the mermaid diagram", async ({ page }) => {
await page.goto("/", { waitUntil: "domcontentloaded" });
await expect(page.getByRole("heading", { name: "Overview" })).toBeVisible();
await expect(page.getByText("Live data connected")).toBeVisible();
await expect(page.locator(".service-grid .service").filter({ hasText: "Nextcloud" }).first()).toBeVisible();
const firstCard = page.locator(".mermaid-card").first();
await expect(firstCard.locator("svg")).toBeVisible();
await firstCard.getByRole("button", { name: "Full screen" }).click();
await expect(page.locator(".overlay")).toBeVisible();
await page.keyboard.press("Escape");
await expect(page.locator(".overlay")).toHaveCount(0);
});