Skip to content

test(desktop): wait for ready WorkHub layout surface - #3963

Merged
Astro-Han merged 1 commit into
apache:mainfrom
Sun-GLiang:fix/3961-workhub-ready-state
Aug 27, 2026
Merged

test(desktop): wait for ready WorkHub layout surface#3963
Astro-Han merged 1 commit into
apache:mainfrom
Sun-GLiang:fix/3961-workhub-ready-state

Conversation

@Sun-GLiang

Copy link
Copy Markdown
Contributor

Summary

Wait for the ready WorkHub surface's exact 1 项工作 projection before filling and submitting through its Composer. This prevents the layout E2E from treating the resolving Coordination status surface as submission-ready while preserving the existing result and non-overlap assertions.

Closes #3961

Verification

  • Baseline stress loop before the change: 9 failed, 51 passed (--repeat-each=60 --workers=4)
  • Focused layout E2E after the change: 20 passed (--repeat-each=20 --workers=1)
  • Coordination startup failure/recovery E2E: 1 passed
  • npx biome check apps/desktop/e2e/workhub-layout.spec.ts
  • npm --workspace @maka/desktop run typecheck

AI use

Select exactly one:

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

Tool(s) and scope: Codex analyzed and reproduced the race, implemented the E2E synchronization change, and ran verification.

Checklist

  • Tests cover the change and fail without it
  • Lint, format, typecheck and the affected suites pass locally

Does this PR entail a change in behavior?

  • Yes — described under Summary above
  • No

@github-actions github-actions Bot added the effort/XS Under 10 readable lines label Aug 27, 2026

@Astro-Han Astro-Han left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes the readiness gate in apps/desktop/e2e/workhub-layout.spec.ts from the main landmark to the projected work count 1 项工作, so the test stops filling the Composer while the Coordination status surface is still resolving (#3961).

What I checked:

  • The old locator getByRole('main', { name: 'WorkHub' }) becomes visible as soon as the shell mounts, which is strictly before the projection resolves. The new locator targets workCount from workhub-surface.tsx:625, which only renders once the projection has a count. So this is a strictly stronger gate, not a lateral move — it waits for the state the rest of the test actually depends on.
  • The assertion still fails if the WorkHub surface never appears, so no coverage is lost by dropping the landmark check; the count only renders inside that surface.
  • The preceding block creates exactly one Session, so 1 is the deterministic count rather than an incidental one.
  • A hard-coded Chinese string is consistent with this file, which already locates by 重新生成 and fills 支付回调幂等性.

Test-only, no product change. Approving.

AI use: Claude Code (Opus) traced the new locator to the workCount copy in workhub-surface.tsx and checked what the old landmark actually gated on. The stress-loop numbers are the author's, reported and not independently re-run. The reviewer of record reviewed and accepted this.

简体中文

apps/desktop/e2e/workhub-layout.spec.ts 的就绪判据从 main landmark 换成投影出来的工作计数 1 项工作,避免在 Coordination 状态面还在解析时就往 Composer 里填内容(#3961)。

核对了四点:

  • 旧的 getByRole('main', { name: 'WorkHub' }) 在外壳挂载时就可见,严格早于投影完成;新定位指向 workhub-surface.tsx:625workCount,只有拿到计数才渲染。所以这是更强的判据,不是平移——它等的正是后续步骤真正依赖的状态。
  • WorkHub 面若始终不出现,断言仍会失败,去掉 landmark 检查没有损失覆盖,因为计数只在该面内渲染。
  • 前一段只创建了一个 Session,所以 1 是确定值而非偶然值。
  • 硬编码中文串与本文件既有风格一致(已有 重新生成支付回调幂等性)。

纯测试改动,无产品行为变化。Approve。

@Astro-Han
Astro-Han merged commit 854391a into apache:main Aug 27, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/XS Under 10 readable lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(desktop): WorkHub layout E2E flakes while Coordination Session is resolving

2 participants