From 8c8690b0fb77007ad7d21f9eb2318871bc0b6474 Mon Sep 17 00:00:00 2001 From: Javen Cinocca <129346815+javenciu@users.noreply.github.com> Date: Sun, 1 Nov 2026 20:04:06 +0000 Subject: [PATCH] test(app): act-wrap the hydrate-reconcile boot render and store reset Make website/src/test/App.terminalHydrateReconcile.test.tsx stop emitting React act() warnings, and drop its row from website/integration/act-warning-baseline.json so the guard in website/integration/setup.ts checks it. --- website/integration/act-warning-baseline.json | 1 - .../src/test/App.terminalHydrateReconcile.test.tsx | 14 ++++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/website/integration/act-warning-baseline.json b/website/integration/act-warning-baseline.json index b3436ebf170b..7e3c2c21df1d 100644 --- a/website/integration/act-warning-baseline.json +++ b/website/integration/act-warning-baseline.json @@ -4,7 +4,6 @@ "src/pages/members/MembersPage.newCrewmate.test.tsx", "src/pages/settings/decisionsCard.test.tsx", "src/test/AboutPanel.inAppApply.test.tsx", - "src/test/App.terminalHydrateReconcile.test.tsx", "src/test/AppDetailPageCoverage.test.tsx", "src/test/ArtifactsPageCoverage.test.tsx", "src/test/ChatFooter.test.tsx", diff --git a/website/src/test/App.terminalHydrateReconcile.test.tsx b/website/src/test/App.terminalHydrateReconcile.test.tsx index 0f27379c176d..e1d5f2c3ca74 100644 --- a/website/src/test/App.terminalHydrateReconcile.test.tsx +++ b/website/src/test/App.terminalHydrateReconcile.test.tsx @@ -15,7 +15,7 @@ * them, so App and its providers share one context module instance. */ import { describe, it, expect, vi, afterEach } from 'vitest' -import { waitFor } from '@testing-library/react' +import { waitFor, act } from '@testing-library/react' import { http, HttpResponse, delay } from 'msw' import { server } from '../../integration/mocks/server' // Warm-up only: transforming App's import graph is the slow part, and paying @@ -97,13 +97,19 @@ async function bootApp() { const { default: App } = await import('../App') expect(store.isTerminalHydratePending()).toBe(true) registry.setTerminalEnabledFlag(true) - renderWithProviders(, { route: '/chat' }) + // The boot effects (status fetch into redux, the topbar measure) update App in + // microtasks after the commit. Async act keeps the scope open until they land, + // for every case that boots through here. + await act(async () => { renderWithProviders(, { route: '/chat' }) }) return store } afterEach(() => { - store?.__resetBottomTerminal() - registry?.setTerminalEnabledFlag(false) + // The dock panel is still mounted here, so the reset's emit re-renders it. + act(() => { + store?.__resetBottomTerminal() + registry?.setTerminalEnabledFlag(false) + }) store = null registry = null localStorage.clear()