mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-07-16 16:58:33 +00:00
test(billing): harden personal→team gate test against cold-run emit race (FE-991)
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.
This commit is contained in:
@@ -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()
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user