test(ui): cover first-read session navigation readiness

Exercise shared navigation as the first readiness consumer in the existing
online late-readiness case. Keep the separate reload regression and every
assertion, and remove the toast-specific wait now owned by the shared helper.

The pre-fix helper fails the regression. Ten full recovery-file runs pass
without the local wait, along with the post-integration focused checks,
scoped lint/types, and P2 review.
This commit is contained in:
Peter Steinberger 2026-10-10 14:46:38 -07:00
parent b4c73dfc0f
commit f3af0db8fc
No known key found for this signature in database
2 changed files with 3 additions and 3 deletions

View file

@ -6,7 +6,6 @@ import type { ApplicationContext } from "../app/context.ts";
import { sessionPlacementRecoveryExactStorageKey } from "../lib/sessions/session-placement-recovery-storage-key.ts";
import type { SessionPlacementPendingRecovery } from "../lib/sessions/session-placement-recovery.ts";
import type { ChatPageHost } from "../pages/chat/chat-state-host.ts";
import { waitForControlUiInitialRoster } from "../test-helpers/control-ui-e2e-readiness.ts";
import {
navigateToControlUiSession,
startProductionControlUiE2eServer,
@ -383,8 +382,6 @@ suite.define(() => {
params: { key: sessionKey, message, idempotencyKey: messageId },
});
if (escape === "toast") {
// Startup replay can send before the reloaded shell publishes its readiness hook.
await waitForControlUiInitialRoster(page);
await navigateToControlUiSession(page, sessionKey);
}
await expect

View file

@ -127,6 +127,9 @@ suite.define(() => {
}
expect(requests).toEqual([]);
if (!offline) {
await navigateToControlUiSession(page, key);
}
await page.waitForFunction(() => window.openclawControlUi?.snapshot().ready === true);
const snapshot = await page.evaluate(() => window.openclawControlUi?.snapshot());
expect(snapshot).toMatchObject({