test(e2e): enter Org-map view before waiting for .react-flow__node (concierge reskin) #2442

Closed
devops-engineer wants to merge 1 commits from fix/e2e-chat-desktop-concierge-reskin-selector into main
+31 -1
View File
@@ -1,7 +1,29 @@
import { test, expect } from "@playwright/test";
import { test, expect, type Page } from "@playwright/test";
import { startEchoRuntime } from "./fixtures/echo-runtime";
import { seedWorkspace, startHeartbeat, cleanupWorkspace } from "./fixtures/chat-seed";
/**
* The Org Concierge reskin (PR f91583efa) changed the desktop entrypoint:
* `app/page.tsx` now renders `<ConciergeShell/>`, whose store defaults to
* `topView: "home"` (canvas/src/store/canvas.ts). The React Flow graph (the
* `.react-flow__node` cards + the side-panel chat these tests drive) only
* mounts when `topView === "map"` — see ConciergeShell's
* `{topView === "map" && <Canvas/>}` branch. So a bare `goto("/")` lands on
* the chat-home view and `.react-flow__node` never appears.
*
* Enter the Org-map view the way a real user does — click the left-rail
* "Org map" nav button (stable `data-testid="nav-map"`, which calls
* `setTopView("map")`) — before waiting for the graph. Mirrors the proven
* `navTo(page, "map")` helper in staging-concierge.spec.ts. `topView` is NOT
* persisted across reloads, so this also runs after `page.reload()`.
*/
async function enterMapView(page: Page): Promise<void> {
const navMap = page.getByTestId("nav-map");
await expect(navMap, "concierge rail button nav-map missing").toBeVisible({
timeout: 10_000,
});
await navMap.click();
}
test.describe("Desktop ChatTab", () => {
let cleanup: () => Promise<void> = async () => {};
@@ -29,6 +51,9 @@ test.describe("Desktop ChatTab", () => {
test.beforeEach(async ({ page }) => {
await page.setViewportSize({ width: 1280, height: 800 });
await page.goto("/");
// Concierge reskin opens on topView:"home"; switch to the Org map so the
// React Flow graph mounts before we wait for it.
await enterMapView(page);
await page.waitForSelector(".react-flow__node", { timeout: 10_000 });
// Dismiss onboarding guide if present.
const skipGuide = page.getByText("Skip guide");
@@ -67,6 +92,8 @@ test.describe("Desktop ChatTab", () => {
await expect(page.getByText("Echo: Persistence test")).toBeVisible({ timeout: 15_000 });
await page.reload();
// Reload resets the concierge store to topView:"home"; re-enter the map.
await enterMapView(page);
await page.waitForSelector(".react-flow__node", { timeout: 10_000 });
await page.getByText(workspaceName, { exact: true }).first().click();
await page.locator('#tab-chat').click();
@@ -143,6 +170,9 @@ test.describe("Desktop ChatTab — Markdown rendering", () => {
test.beforeEach(async ({ page }) => {
await page.setViewportSize({ width: 1280, height: 800 });
await page.goto("/");
// Concierge reskin opens on topView:"home"; switch to the Org map so the
// React Flow graph mounts before we wait for it.
await enterMapView(page);
await page.waitForSelector(".react-flow__node", { timeout: 10_000 });
const skipGuide2 = page.getByText("Skip guide");
if (await skipGuide2.isVisible().catch(() => false)) {