Two focused Playwright tests, mirroring the existing sidebar.spec pattern (no backend dependency — instances point at unreachable ports and we only assert on rendered names + row count, not health): - Fleet link in the sidebar navigates to /fleet - /fleet renders one row per configured instance under the table role Also adds a Fleet link assertion to the existing sidebar.spec so the nav entry is covered on the dashboard route alongside the other top links. Both new tests run under the existing `pnpm test:e2e` (not gated in CI by design — matches the current Compare/Dashboard E2E posture). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
31 lines
1.1 KiB
TypeScript
31 lines
1.1 KiB
TypeScript
import { expect, test } from "@playwright/test";
|
|
|
|
const CONFIG_KEY = "openconcho:config";
|
|
const CONFIG_VALUE = JSON.stringify({ baseUrl: "http://localhost:9999", token: "" });
|
|
|
|
test.describe("Sidebar", () => {
|
|
test.beforeEach(async ({ context }) => {
|
|
await context.addInitScript(
|
|
([key, value]) => {
|
|
window.localStorage.setItem(key, value);
|
|
},
|
|
[CONFIG_KEY, CONFIG_VALUE],
|
|
);
|
|
});
|
|
|
|
test("renders the sidebar nav on the dashboard route", async ({ page }) => {
|
|
await page.goto("/");
|
|
await expect(page.getByRole("complementary")).toBeVisible();
|
|
await expect(page.getByRole("link", { name: /dashboard/i })).toBeVisible();
|
|
await expect(page.getByRole("link", { name: /fleet/i })).toBeVisible();
|
|
await expect(page.getByRole("link", { name: /workspaces/i })).toBeVisible();
|
|
await expect(page.getByRole("link", { name: /settings/i })).toBeVisible();
|
|
});
|
|
|
|
test("renders the sidebar nav on the settings route", async ({ page }) => {
|
|
await page.goto("/settings");
|
|
await expect(page.getByRole("complementary")).toBeVisible();
|
|
await expect(page.getByRole("link", { name: /dashboard/i })).toBeVisible();
|
|
});
|
|
});
|