diff --git a/tests/setup/health-checks.ts b/tests/setup/health-checks.ts index 3f1febb..22a6067 100644 --- a/tests/setup/health-checks.ts +++ b/tests/setup/health-checks.ts @@ -59,8 +59,8 @@ export async function checkRpcFunctional(rpcUrl: string, kraikenAddress?: string } // Step 2: Resolve the Kraiken address for the eth_call probe. - // Use the address supplied by the caller; fall back to deployments-local.json. - let resolvedKraikenAddress = kraikenAddress; + // Priority: caller-supplied address → STACK_KRAIKEN_ADDRESS env var → deployments-local.json. + let resolvedKraikenAddress = kraikenAddress ?? process.env.STACK_KRAIKEN_ADDRESS; if (!resolvedKraikenAddress) { const deploymentsPath = resolve(repoRoot, 'onchain', 'deployments-local.json'); diff --git a/tests/setup/navigate.ts b/tests/setup/navigate.ts index 5770635..de0cbfe 100644 --- a/tests/setup/navigate.ts +++ b/tests/setup/navigate.ts @@ -12,9 +12,11 @@ export async function navigateSPA(page: Page, path: string): Promise { window.history.pushState({}, '', p); window.dispatchEvent(new PopStateEvent('popstate')); }, path); - // waitForURL would resolve immediately (pushState already updated the URL - // synchronously), so wait for networkidle instead: that fires once Vue Router - // has processed the popstate event, mounted the new view, and any route- - // triggered data fetches have settled. - await page.waitForLoadState('networkidle', { timeout: 10_000 }); + // Vue Router processes the popstate event synchronously within evaluate(), + // so the route transition has already started by the time we return here. + // Callers must assert on a route-specific element (e.g. a heading) to confirm + // the view has mounted — that assertion is the readiness signal. + // waitForLoadState('networkidle') is not used because persistent WebSocket + // connections (blockchain event subscriptions) prevent the network from ever + // going idle, causing spurious timeouts. }