Skip to content

Commit 3b309cc

Browse files
committed
fix(ui): wait for presented sidebar session
1 parent 802af31 commit 3b309cc

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

‎ui/src/e2e/session-management.sidebar.e2e.test.ts‎

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import path from "node:path";
22
import { expect, it } from "vitest";
3+
import type { ChatPaneElement } from "../pages/chat/route-draft-focus-handoff.ts";
34
import {
45
waitForControlUiGatewayReady,
56
waitForControlUiGatewayReconnecting,
67
} from "../test-helpers/control-ui-e2e-readiness.ts";
8+
import { waitForControlUiRoute } from "../test-helpers/control-ui-e2e.ts";
79
import { expectRequestCountStable } from "./chat-flow.test-support.ts";
810
import {
911
actionOpacity,
@@ -79,8 +81,19 @@ suite.define(() => {
7981
await draft.waitFor();
8082

8183
await homeRow.click();
82-
await expect.poll(() => new URL(page.url()).pathname).toBe(controlUiSessionPath(mainKey));
84+
await waitForControlUiRoute(page, {
85+
pathname: controlUiSessionPath(mainKey),
86+
routeId: "chat",
87+
});
8388
await draft.waitFor();
89+
const presentedPanes = page.locator('openclaw-chat-pane[aria-hidden="false"]');
90+
await expect
91+
.poll(() =>
92+
presentedPanes.evaluateAll((panes) =>
93+
panes.map((pane) => (pane as ChatPaneElement).sessionKey),
94+
),
95+
)
96+
.toEqual([mainKey]);
8497

8598
await composer.fill("");
8699
await secondRow.getByRole("link").click();

0 commit comments

Comments
 (0)