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
This commit is contained in:
程序员阿江(Relakkes) 2026-05-06 14:54:17 +08:00
parent d1bf65d107
commit d1f3b1f91b

View File

@ -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({