42 lines
1.9 KiB
TypeScript
42 lines
1.9 KiB
TypeScript
// Interim pixel baseline for the VD-MCP connect dialog (AD-28, DoD D.21).
|
|
// The PNG baselines are not committed: this suite is not part of CI, and the
|
|
// Playwright browser download was not available on the authoring machine. Run
|
|
// `npx playwright install chromium` once, then
|
|
// `npx playwright test --config=playwright-ct.config.ts vd-mcp-connect-interim --update-snapshots`
|
|
// to write them.
|
|
|
|
import { expect, test } from "@playwright/experimental-ct-react";
|
|
|
|
import { McpConnectEmptyVisualFixture, McpConnectVisualFixture } from "../../apps/web/app/components/mcp/mcp-connect.visual-fixture";
|
|
|
|
const DIALOG_ID = "ui.mcp.connect.dialog";
|
|
const CONNECTOR_ID = "ui.mcp.connect.connectorUrl";
|
|
|
|
test.describe("VD-MCP connect dialog interim UI pixel baseline", () => {
|
|
test("desktop dialog stays visually stable", async ({ mount, page }) => {
|
|
await mount(<McpConnectVisualFixture />);
|
|
await page.evaluate(async () => {
|
|
await document.fonts.ready;
|
|
});
|
|
|
|
const dialog = page.locator(`[data-ui-id="${DIALOG_ID}"]`);
|
|
await expect(dialog).toBeVisible();
|
|
// The connector URL is the one value a user must copy correctly; if it ever
|
|
// renders truncated or empty the screenshot alone would not say so.
|
|
await expect(page.locator(`[data-ui-id="${CONNECTOR_ID}"]`)).toContainText("https://mcp.hivegrid.example");
|
|
await expect(dialog).toHaveScreenshot("vd-mcp-connect-desktop.png");
|
|
});
|
|
|
|
test("empty connection list stays visually stable", async ({ mount, page }) => {
|
|
await mount(<McpConnectEmptyVisualFixture />);
|
|
await page.evaluate(async () => {
|
|
await document.fonts.ready;
|
|
});
|
|
|
|
const dialog = page.locator(`[data-ui-id="${DIALOG_ID}"]`);
|
|
await expect(dialog).toBeVisible();
|
|
await expect(page.locator('[data-ui-id="ui.mcp.connect.connections.empty"]')).toBeVisible();
|
|
await expect(dialog).toHaveScreenshot("vd-mcp-connect-empty.png");
|
|
});
|
|
});
|