Skip to content

test: follow the empty overview's own call to action - #18

Merged
yujiezhang-ops merged 1 commit into
mainfrom
fix/stale-overview-test
Aug 4, 2026
Merged

test: follow the empty overview's own call to action#18
yujiezhang-ops merged 1 commit into
mainfrom
fix/stale-overview-test

Conversation

@yujiezhang-ops

Copy link
Copy Markdown
Collaborator

main 上有 1 个前端测试失败,是 #17 留下的。新 CI 在 #17 合并时还没生效,所以没拦住。

不是代码的问题,是测试过期了

refactor: use step-by-step guide for desktop agents 把顶部的「安装命令行 Agent」按钮加了条件:

{installed.length || desktopInstalled ? (
  <button ... onClick={startSetup}>{t("安装命令行 Agent")}</button>
) : null}

这是有意的——什么都没装时,空状态自己有一个 primary 按钮「安装 Agent」承担引导,顶部工具栏不必重复一遍。但 EnvironmentOverviewPage.test.tsx:87 仍然去点顶部那个,于是 Unable to find an accessible element with the role "button" and name "安装命令行 Agent"

改成点空状态实际渲染的那个按钮,并额外断言顶部那个不存在——把 #17 选择的这个布局钉住,而不是留给下一个人重新发现。

做了变异测试确认它仍然有效:把空状态按钮的 onClick 断开,测试立刻失败。

验证

go vet 无输出、go test -race ./... 全过、前端 pnpm run build 通过、pnpm run test 156/156

修完这个,main 三道门全绿。

🤖 Generated with Claude Code

`refactor: use step-by-step guide for desktop agents` gated the header's
"安装命令行 Agent" on `installed.length || desktopInstalled`, so with nothing
installed it is deliberately absent -- the empty state owns the call to
action as its own primary button. The test still clicked the header one and
failed to find it.

The test now clicks the button the empty state actually renders, and asserts
the header's is absent, so the arrangement this refactor chose is pinned
rather than left to be rediscovered. Confirmed it still catches a
regression: disconnecting the empty state's onClick fails it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@yujiezhang-ops
yujiezhang-ops merged commit 82e506e into main Aug 4, 2026
2 checks passed
@yujiezhang-ops
yujiezhang-ops deleted the fix/stale-overview-test branch August 4, 2026 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant