b41c1d2501
CI / Architecture Guardrails (push) Successful in 2m38s
CI / Assistant Split Regression (push) Successful in 3m33s
CI / Typecheck (push) Successful in 3m51s
CI / Lint (push) Successful in 5m2s
CI / E2E Tests (push) Has been cancelled
CI / Fresh-Linux Docker Deploy (push) Has been cancelled
CI / Release Images (push) Has been cancelled
CI / Build (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
rename(phase 1): CapaKraken → Nexus across code, UI, docs, CI (#61) Co-authored-by: Hartmut Nörenberg <hn@hartmut-noerenberg.com> Co-committed-by: Hartmut Nörenberg <hn@hartmut-noerenberg.com>
49 lines
1.8 KiB
TypeScript
49 lines
1.8 KiB
TypeScript
import { expect, test } from "@playwright/test";
|
|
|
|
test.describe("Dashboard", () => {
|
|
test.beforeEach(async ({ page }) => {
|
|
await page.goto("/auth/signin");
|
|
await page.fill('input[type="email"]', "admin@nexus.dev");
|
|
await page.fill('input[type="password"]', "admin123");
|
|
await page.click('button[type="submit"]');
|
|
await expect(page).toHaveURL(/\/(dashboard|resources)/);
|
|
await page.goto("/dashboard");
|
|
});
|
|
|
|
test("loads with widget grid", async ({ page }) => {
|
|
await page.waitForLoadState("networkidle");
|
|
// Dashboard should render the react-grid-layout container
|
|
await expect(page.locator(".react-grid-layout")).toBeVisible({ timeout: 10000 });
|
|
});
|
|
|
|
test("shows at least one widget", async ({ page }) => {
|
|
await page.waitForLoadState("networkidle");
|
|
// Each widget is wrapped in a WidgetContainer inside the grid
|
|
const widgets = page.locator(".react-grid-item");
|
|
await expect(widgets.first()).toBeVisible({ timeout: 10000 });
|
|
const count = await widgets.count();
|
|
expect(count).toBeGreaterThanOrEqual(1);
|
|
});
|
|
|
|
test("add widget modal opens and closes", async ({ page }) => {
|
|
await page.waitForLoadState("networkidle");
|
|
// Look for the "Add Widget" button
|
|
const addBtn = page.locator("button", { hasText: /Add Widget/i });
|
|
if ((await addBtn.count()) > 0) {
|
|
await addBtn.click();
|
|
await expect(
|
|
page.locator("text=Add Widget").or(page.locator("text=Available Widgets")),
|
|
).toBeVisible();
|
|
await page.keyboard.press("Escape");
|
|
}
|
|
});
|
|
|
|
test("reset layout button is available", async ({ page }) => {
|
|
await page.waitForLoadState("networkidle");
|
|
const resetBtn = page.locator("button", { hasText: /Reset Layout/i });
|
|
if ((await resetBtn.count()) > 0) {
|
|
await expect(resetBtn).toBeVisible();
|
|
}
|
|
});
|
|
});
|