Skip to content

fix(vscode): Fix 'create unit test' and 'create unit test from run' in v2 designer#9398

Open
andrew-eldridge wants to merge 3 commits into
mainfrom
aeldridge/v2-designer-unit-tests
Open

fix(vscode): Fix 'create unit test' and 'create unit test from run' in v2 designer#9398
andrew-eldridge wants to merge 3 commits into
mainfrom
aeldridge/v2-designer-unit-tests

Conversation

@andrew-eldridge

@andrew-eldridge andrew-eldridge commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Commit Type

  • feature - New functionality
  • fix - Bug fix
  • refactor - Code restructuring without behavior change
  • perf - Performance improvement
  • docs - Documentation update
  • test - Test-related changes
  • chore - Maintenance/tooling

Risk Level

  • Low - Minor changes, limited scope
  • Medium - Moderate changes, some user impact
  • High - Major changes, significant user/system impact

What & Why

Adds 'Create unit test' option to menu in v2 designer and ensures 'Create unit test from run' option only appears when in monitoring view (accessed through overview).

Impact of Change

  • Users: Updates V2 designer to support the same 'Create unit test' actions as V1 designer
  • Developers: N/A
  • System: N/A

Test Plan

  • Unit tests added/updated
  • E2E tests added/updated
  • Manual testing completed
  • Tested in:

Contributors

@andrew-eldridge

@andrew-eldridge andrew-eldridge added VSCode Issues or PRs specific to VS Code extension risk:low Low risk change with minimal impact labels Jul 14, 2026
@github-actions

github-actions Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

🤖 AI PR Validation Report

PR Review Results

Thank you for your submission! Here's detailed feedback on your PR title and body compliance:

PR Title

  • Current: fix(vscode): Fix 'create unit test' and 'create unit test from run' in v2 designer
  • Issue: None — uses the valid fix(vscode): prefix and is descriptive.
  • Recommendation: No changes needed.

Commit Type

  • Exactly one type selected: fix - Bug fix.
  • Matches the title prefix and the nature of the change.

Risk Level

  • Declared Medium (body) and risk:medium label both match my advised estimate of medium. Changes touch the VS Code extension host (apps/vs-code-designer) and its React webview (apps/vs-code-react) — extension distribution code, which is medium per the rubric. Correctly declared.

What & Why

  • Current: "Adds 'Create unit test' option to menu in v2 designer and ensures 'Create unit test from run' option only appears when in monitoring view (accessed through overview)."
  • Issue: None — clear and specific.
  • Recommendation: No changes needed.

Impact of Change

  • All three audiences addressed (Users described; Developers/System marked N/A, which is acceptable here).
  • Recommendation:
    • Users: Good — V2 designer now supports the same unit-test actions as V1.
    • Developers: N/A is acceptable; optionally note the temporary createUnitTestFromRun handler in openDesignerForLocalProject.ts pending V2 panel classes.
    • System: N/A is acceptable.

Test Plan

  • Unit tests added/updated (confirmed in indexV2.test.tsx — 10 new cases covering visibility, disabled state, and message posting) and manual testing checked. Passes.

⚠️ Contributors

  • @andrew-eldridge credited. Consider crediting any PM/designer involved if applicable.

⚠️ Screenshots/Videos

  • The change adds menu items to a webview command bar (apps/vs-code-react). If this alters visible UI, please attach a screenshot/GIF of the new menu items. Not blocking.

Summary Table

Section Status Recommendation
Title No changes needed
Commit Type No changes needed
Risk Level Medium is correct
What & Why No changes needed
Impact of Change Optional: note temporary handler
Test Plan Unit tests present
Contributors ⚠️ Credit PM/designer if any
Screenshots/Videos ⚠️ Add UI screenshot if visual

All required checks pass — this PR is compliant and good to merge. Address the optional warnings if relevant.


Powered by: Copilot CLI (claude-opus-4.8) | Last updated: Fri, 17 Jul 2026 16:56:09 GMT

@github-actions

github-actions Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

📊 Coverage Check

The following changed files need attention:

⚠️ apps/vs-code-designer/src/app/commands/workflows/openDesigner/openDesignerForLocalProject.ts - 79% covered (needs improvement)
⚠️ apps/vs-code-react/src/app/designer/DesignerCommandBar/indexV2.tsx - 60% covered (needs improvement)

Please add tests for the uncovered files before merging.

Copilot AI 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.

Pull request overview

Updates the VS Code V2 designer command bar to match V1’s unit test creation capabilities by re-enabling “Create unit test” and scoping “Create unit test from run” to the monitoring view context.

Changes:

  • Reintroduces the V2 “Create unit test” action via a React Query mutation and adds it to the overflow menu (designer view only).
  • Restricts “Create unit test from run” to monitoring view when runId is present (local only).
  • Adds/extends unit tests around unit test menu item visibility and enables the extension’s local designer panel to handle createUnitTestFromRun.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
apps/vs-code-react/src/app/designer/DesignerCommandBar/indexV2.tsx Adds V2 “Create unit test” mutation + menu item; gates “from run” to monitoring view with runId.
apps/vs-code-react/src/app/designer/DesignerCommandBar/test/indexV2.test.tsx Adds unit tests for unit test menu item visibility/disabled state and “from run” click routing.
apps/vs-code-designer/src/app/commands/workflows/openDesigner/openDesignerForLocalProject.ts Adds handling for ExtensionCommand.createUnitTestFromRun in the local designer panel message router.

Comment thread apps/vs-code-react/src/app/designer/DesignerCommandBar/indexV2.tsx
@andrew-eldridge
andrew-eldridge enabled auto-merge (squash) July 14, 2026 21:07
@andrew-eldridge andrew-eldridge added risk:medium Medium risk change with potential impact and removed needs-pr-update risk:low Low risk change with minimal impact labels Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-validated risk:medium Medium risk change with potential impact VSCode Issues or PRs specific to VS Code extension

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants