Skip to content

test(shared): 抽取 AgentHubWorkbench 测试共享 fixtures(#1763 首步) - #1769

Open
DeliciousBuding wants to merge 1 commit into
masterfrom
simp/workbench-test-fixtures
Open

test(shared): 抽取 AgentHubWorkbench 测试共享 fixtures(#1763 首步)#1769
DeliciousBuding wants to merge 1 commit into
masterfrom
simp/workbench-test-fixtures

Conversation

@DeliciousBuding

Copy link
Copy Markdown
Collaborator

概要(#1763 首步,只做减法)

AgentHubWorkbench.test.tsx(3269 行 / 78 用例)中的两个大型共享数据 fixture 抽取为可复用的纯数据模块。

抽取内容

  • 新增 app/shared/src/workbench/workbenchTestFixtures.ts(143 行,纯数据、带类型):
    • workbenchAgents: WorkbenchAgent[](原 agents,Builder/Reviewer 两个 agent)
    • workbenchTranscript: TranscriptBlock[](原 transcript,覆盖 text/tool_call/run_session/thinking/route_decision/subagent/timeline/child_agent/context/diff/artifact/result 共 12 种块)
  • 测试文件以别名导入(workbenchAgents as agents 等),78 个用例的引用点零改动。
  • 未移动任何 vi.mock(virtua + @lobehub/icons 约 60 行 mock 原样留在测试文件)、组件或 render 调用。

验证

项目 结果
测试(抽取前) 78 passed (78)
测试(抽取后) 78 passed (78),全部通过
npx tsc --noEmit(app/shared) 0 errors
ESLint(两个改动文件) 0 errors(仅 1 条与本次无关的既有 warning)
Prettier 新文件 check 通过;测试文件未引入新违规

行数变化

  • 主测试文件:3269 → 3134 行(-135
  • diff 统计:2 files changed, +156 / -136

- 将 agents / transcript 两个共享数据 fixture 抽到
  workbenchTestFixtures.ts(纯数据、带类型,导出
  workbenchAgents / workbenchTranscript),测试文件以别名导入。
- 不移动任何 vi.mock / 组件 / render;virtua 仍只在该文件内 mock。
- 测试 78/78 通过(前后一致),tsc --noEmit 0 错误,
  主测试文件 3269 → 3134 行(-135)。

Co-authored-by: Cursor <cursor@vectorcontrol.tech>
@DeliciousBuding DeliciousBuding added javascript Pull requests that update javascript code P2 Medium priority lane-B Parallel lane B labels Aug 18, 2026
@coderabbitai

coderabbitai Bot commented Aug 18, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@DeliciousBuding, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 57 minutes

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits within each organization.

For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 1b287692-b7a9-4c23-b30e-96170bf2e517

📥 Commits

Reviewing files that changed from the base of the PR and between de446df and 77b55bb.

📒 Files selected for processing (2)
  • app/shared/src/workbench/AgentHubWorkbench.test.tsx
  • app/shared/src/workbench/workbenchTestFixtures.ts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

javascript Pull requests that update javascript code lane-B Parallel lane B P2 Medium priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant