From 4e609999d44ffb3eefd6f1a36dfd2d90409e65a7 Mon Sep 17 00:00:00 2001 From: dante01yoon Date: Mon, 22 Jun 2026 00:20:55 +0900 Subject: [PATCH] =?UTF-8?q?test(billing):=20harden=20personal=E2=86=92team?= =?UTF-8?q?=20gate=20test=20against=20cold-run=20emit=20race=20(FE-991)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The new container gate test could fail on a cold-cache first run (onChooseTeam observed 0 calls) due to a userEvent/happy-dom event-dispatch warm-up race; the gate source is synchronous and correct. Wrap the positive assertions in vi.waitFor so the emit lands deterministically. --- .../SubscriptionRequiredDialogContentUnified.test.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/platform/workspace/components/SubscriptionRequiredDialogContentUnified.test.ts b/src/platform/workspace/components/SubscriptionRequiredDialogContentUnified.test.ts index a7e87dbfbf..cdae60d7fd 100644 --- a/src/platform/workspace/components/SubscriptionRequiredDialogContentUnified.test.ts +++ b/src/platform/workspace/components/SubscriptionRequiredDialogContentUnified.test.ts @@ -97,7 +97,9 @@ describe('SubscriptionRequiredDialogContentUnified team-plan gate', () => { await user.click(screen.getByTestId('subscribe-team-btn')) - expect(onChooseTeam).toHaveBeenCalledOnce() + await vi.waitFor(() => { + expect(onChooseTeam).toHaveBeenCalledOnce() + }) expect(mockHandleSubscribeTeamClick).not.toHaveBeenCalled() }) @@ -109,7 +111,9 @@ describe('SubscriptionRequiredDialogContentUnified team-plan gate', () => { await user.click(screen.getByTestId('subscribe-team-btn')) - expect(mockHandleSubscribeTeamClick).toHaveBeenCalledWith(TEAM_PAYLOAD) + await vi.waitFor(() => { + expect(mockHandleSubscribeTeamClick).toHaveBeenCalledWith(TEAM_PAYLOAD) + }) expect(onChooseTeam).not.toHaveBeenCalled() }) })