From d1f3b1f91b993b83d95c995617b1dfee41b8607e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E5=91=98=E9=98=BF=E6=B1=9F=28Relakkes?= =?UTF-8?q?=29?= Date: Wed, 6 May 2026 14:54:17 +0800 Subject: [PATCH] test: wait for desktop repository launch readiness The branch label can render before the parent composer receives the launch-ready callback, especially after the main branch notification UI changes added more render work. The test now waits for the same enabled Run state a user can interact with before submitting. Constraint: The product intentionally disables Run while repository context is still resolving Rejected: Loosen the create-session assertion | the assertion is still the behavior this flow must guarantee Confidence: high Scope-risk: narrow Tested: cd desktop && bun run test -- src/pages/EmptySession.test.tsx --run --- desktop/src/pages/EmptySession.test.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/desktop/src/pages/EmptySession.test.tsx b/desktop/src/pages/EmptySession.test.tsx index 94f8d461..838cabe4 100644 --- a/desktop/src/pages/EmptySession.test.tsx +++ b/desktop/src/pages/EmptySession.test.tsx @@ -163,7 +163,12 @@ describe('EmptySession', () => { expect(screen.getByText('main')).toBeInTheDocument() }) - fireEvent.click(screen.getByRole('button', { name: /Run/i })) + const runButton = screen.getByRole('button', { name: /Run/i }) + await waitFor(() => { + expect(runButton).not.toBeDisabled() + }) + + fireEvent.click(runButton) await waitFor(() => { expect(mocks.createSession).toHaveBeenCalledWith({