Skip to content

[issues/506] Convert R-D Bind to Destination TCs to assisted mode (9 TCs)#512

Merged
couimet merged 3 commits into
mainfrom
issues/506
Mar 31, 2026
Merged

[issues/506] Convert R-D Bind to Destination TCs to assisted mode (9 TCs)#512
couimet merged 3 commits into
mainfrom
issues/506

Conversation

@couimet
Copy link
Copy Markdown
Owner

@couimet couimet commented Mar 31, 2026

Summary

Adds 9 assisted integration tests for the R-D Bind to Destination flow — the multi-step pattern where the human opens the picker, selects a destination, and the test asserts toast/status bar messages via log capture. Also removes 3 duplicate TCs (001-003) that were fully covered by existing terminal/file picker tests.

Changes

  • New bindToDestination.test.ts with 9 [assisted] tests covering bind success (terminal, file, AI assistant), smart-bind confirmation dialog (items, Yes/replace, No/keep), escape handling, and AI assistant re-bind/switch scenarios
  • Deleted TCs 001-003 from QA YAML — "picker opens via trigger X" was already tested by every terminal/file picker assisted test (no renumbering per QA001)
  • Updated TCs 004-012 from automated: false to automated: assisted
  • AI assistant TCs (006, 011, 012) are included as assisted — they require running in an IDE with the relevant extensions installed
  • TC 012 (switch between AI assistants) includes a setup waitForHuman prompting to install a second AI extension; will be fully testable once Extend AI assistants via custom settings #500 (custom AI assistants) lands
  • Fixed smart-bind confirmation tests (007, 009) — removed incorrect "Escape again" step; the confirmation dialog is invoked after DestinationPicker.pick() returns (in commitBind), so no parent picker reopens

Test Plan

  • All 1737 unit tests pass (99 suites)
  • QA coverage validator passes (38 assisted entries, 59 automated, 98 false)
  • 9/10 assisted tests pass with human interaction (pnpm test:release:grep "bind-to-destination")
  • TC 012 deferred — requires two AI assistant extensions in the test host (blocked on Extend AI assistants via custom settings #500)

Documentation

  • CHANGELOG: not needed — test infrastructure, not user-facing
  • README: not needed

Related

Summary by CodeRabbit

  • Tests
    • Removed three manual bind-to-destination test cases; remaining destination-binding cases changed from "manual" to "assisted"
    • Added an end-to-end integration suite validating bind-to-destination flows (terminal, editor, AI assistant switching, confirmations, and dismissal behavior)
    • Introduced shared test helpers for creating/opening files and terminals and for locating bindable items; updated existing tests to use these helpers
    • Extended a test precondition to require at least two AI assistant extensions active

…TCs)

## Summary

Adds 9 assisted integration tests for the R-D Bind to Destination flow — the multi-step pattern where the human opens the picker, selects a destination, and the test asserts toast/status bar messages via log capture. Also removes 3 duplicate TCs (001-003) that were fully covered by existing terminal/file picker tests.

## Changes

- New `bindToDestination.test.ts` with 9 `[assisted]` tests covering bind success (terminal, file, AI assistant), smart-bind confirmation dialog (items, Yes/replace, No/keep), escape handling, and AI assistant re-bind/switch scenarios
- Deleted TCs 001-003 from QA YAML — "picker opens via trigger X" was already tested by every terminal/file picker assisted test (no renumbering per QA001)
- Updated TCs 004-012 from `automated: false` to `automated: assisted`
- AI assistant TCs (006, 011, 012) are included as assisted — they require running in an IDE with the relevant extensions installed
- TC 012 (switch between AI assistants) includes a setup `waitForHuman` prompting to install a second AI extension; will be fully testable once #500 (custom AI assistants) lands
- Fixed smart-bind confirmation tests (007, 009) — removed incorrect "Escape again" step; the confirmation dialog is invoked after `DestinationPicker.pick()` returns (in `commitBind`), so no parent picker reopens

## Test Plan

- [x] All 1737 unit tests pass (99 suites)
- [x] QA coverage validator passes (38 assisted entries, 59 automated, 98 false)
- [x] 9/10 assisted tests pass with human interaction (`pnpm test:release:grep "bind-to-destination"`)
- [ ] TC 012 deferred — requires two AI assistant extensions in the test host (blocked on #500)

## Documentation

- CHANGELOG: not needed — test infrastructure, not user-facing
- README: not needed

## Related

- Closes #506
- Parent: #504
- Blocked: TC 012 depends on #500 for testability
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 31, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: d65442d6-012d-45c5-92a8-07be4ce8723f

📥 Commits

Reviewing files that changed from the base of the PR and between 52611ad and 1116abf.

📒 Files selected for processing (1)
  • packages/rangelink-vscode-extension/src/__integration-tests__/suite/bindToDestination.test.ts
✅ Files skipped from review due to trivial changes (1)
  • packages/rangelink-vscode-extension/src/integration-tests/suite/bindToDestination.test.ts

Walkthrough

Updates QA bind-to-destination test cases from manual to assisted, adds a new assisted-mode integration test suite for bind-to-destination, and introduces/shared test helpers for creating/opening files and terminals; existing integration tests were refactored to use the new helpers.

Changes

Cohort / File(s) Summary
QA Test Case Definitions
packages/rangelink-vscode-extension/qa/qa-test-cases-v1.1.0-003.yaml
Removed three manual bind-to-destination TCs (001–003); changed remaining bind-to-destination TCs (004–012) from automated: false to assisted; added precondition for bind-to-destination-012 requiring ≥2 AI assistant extensions.
New Integration Test Suite
packages/rangelink-vscode-extension/src/__integration-tests__/suite/bindToDestination.test.ts
Added assisted integration tests exercising bind-to-destination flows (terminal, editor, AI assistant), QuickPick parsing from logs, confirmation dialog flows, and status/toast assertions.
Test Helpers (added/expanded)
packages/rangelink-vscode-extension/src/__integration-tests__/helpers/fileHelpers.ts, .../terminalHelpers.ts, .../index.ts
Added createAndOpenFile and findTestItemsByPrefix to file helpers; added createTerminal and findTerminalItems to terminal helpers; re-exported these from helpers index and imported settle where needed.
Updated Integration Tests (helper usage)
packages/rangelink-vscode-extension/src/__integration-tests__/suite/filePicker.test.ts, .../terminalPicker.test.ts
Replaced local helper implementations with shared helpers (createAndOpenFile, findTestItemsByPrefix, createTerminal, findTerminalItems); adjusted call sites to pass tracking arrays and removed duplicated helper code.

Sequence Diagram(s)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related issues

Possibly related PRs

Poem

🐰 I hopped through pickers, bright and quick,

Assisted hops, a testing trick.
Terminals, files, AI in sight—
A rabbit's log to celebrate the night. 🥕

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Title clearly indicates the primary change: conversion of 9 Bind to Destination test cases from automated to assisted mode, addressing issue #506.
Linked Issues check ✅ Passed Changes fully implement issue #506 requirements: new bindToDestination.test.ts provides 9 assisted integration tests covering bind success, smart-bind confirmations, escape handling, and AI assistant scenarios with automated validation.
Out of Scope Changes check ✅ Passed All changes are directly scoped to issue #506: test case conversions, new assisted tests, helper function additions for test infrastructure, and YAML test case updates are all related to Bind to Destination test coverage.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch issues/506

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 and usage tips.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 31, 2026

⚠️ QA Coverage Gap Detected

The PR modifies existing test cases to change their automation status from false to assisted, indicating that they require manual testing due to UI interactions. This introduces a need for additional test cases to cover the new confirmation dialog behavior and ensure comprehensive testing of the binding functionality.

Suggested test cases:

  • R-D Bind to Destination: Confirm binding to a new AI assistant shows confirmation dialog (manual — Requires interaction with a confirmation dialog.)
  • R-D Bind to Destination: Confirm replacing an existing binding shows confirmation dialog (manual — Requires interaction with a confirmation dialog.)

Generated by QA Gap Check (GPT-4o-mini via GitHub Models)

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
packages/rangelink-vscode-extension/src/__integration-tests__/suite/bindToDestination.test.ts (1)

198-202: Consider extracting AI_ASSISTANT_DISPLAY_NAMES to a shared constant.

This array is duplicated at lines 400-403. Extracting it to the top of the suite would improve maintainability if AI assistant names need updating.

♻️ Proposed refactor
 suite('R-D Bind to Destination', () => {
   const log = createLogger('bindToDestination');
   const terminals: vscode.Terminal[] = [];
   const tmpFileUris: vscode.Uri[] = [];
+  const AI_ASSISTANT_DISPLAY_NAMES = [
+    'Claude Code Chat',
+    'Cursor AI Assistant',
+    'GitHub Copilot Chat',
+  ];

Then reference AI_ASSISTANT_DISPLAY_NAMES in both TC 006 and TC 011.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@packages/rangelink-vscode-extension/src/__integration-tests__/suite/bindToDestination.test.ts`
around lines 198 - 202, The array AI_ASSISTANT_DISPLAY_NAMES is duplicated in
the test suite; extract it into a single shared constant at the top of the test
file (e.g., above the describe block) and replace the duplicated literals in
both test cases (TC 006 and TC 011) with references to that constant to avoid
drift and make updates simpler; ensure any imports or scope changes still allow
both tests to access AI_ASSISTANT_DISPLAY_NAMES.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In
`@packages/rangelink-vscode-extension/src/__integration-tests__/suite/bindToDestination.test.ts`:
- Around line 198-202: The array AI_ASSISTANT_DISPLAY_NAMES is duplicated in the
test suite; extract it into a single shared constant at the top of the test file
(e.g., above the describe block) and replace the duplicated literals in both
test cases (TC 006 and TC 011) with references to that constant to avoid drift
and make updates simpler; ensure any imports or scope changes still allow both
tests to access AI_ASSISTANT_DISPLAY_NAMES.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 362994b5-d532-4b65-9f0b-3d02a56459e0

📥 Commits

Reviewing files that changed from the base of the PR and between bd95af4 and 1926c7c.

📒 Files selected for processing (2)
  • packages/rangelink-vscode-extension/qa/qa-test-cases-v1.1.0-003.yaml
  • packages/rangelink-vscode-extension/src/__integration-tests__/suite/bindToDestination.test.ts

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
packages/rangelink-vscode-extension/src/__integration-tests__/suite/bindToDestination.test.ts (1)

160-185: Consider extracting AI assistant names to a shared constant.

The AI_ASSISTANT_DISPLAY_NAMES array is duplicated in TC 006 and TC 011. Consider extracting to a suite-level or module-level constant to keep them in sync.

♻️ Suggested refactor
 suite('R-D Bind to Destination', () => {
   const log = createLogger('bindToDestination');
   const terminals: vscode.Terminal[] = [];
   const tmpFileUris: vscode.Uri[] = [];
+  const AI_ASSISTANT_DISPLAY_NAMES = [
+    'Claude Code Chat',
+    'Cursor AI Assistant',
+    'GitHub Copilot Chat',
+  ];

   // ... in test cases, reference the shared constant
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@packages/rangelink-vscode-extension/src/__integration-tests__/suite/bindToDestination.test.ts`
around lines 160 - 185, Extract the duplicated AI_ASSISTANT_DISPLAY_NAMES array
into a shared constant and reference it from both tests: define a single
exported constant (e.g., AI_ASSISTANT_DISPLAY_NAMES) at the top of this test
module or in a test utilities module, then replace the local arrays in the tests
"bind-to-destination-006" and "bind-to-destination-011" with that constant;
ensure both tests import/use the same symbol so the list stays in sync and
update any assertions to reference the shared constant.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In
`@packages/rangelink-vscode-extension/src/__integration-tests__/suite/bindToDestination.test.ts`:
- Around line 160-185: Extract the duplicated AI_ASSISTANT_DISPLAY_NAMES array
into a shared constant and reference it from both tests: define a single
exported constant (e.g., AI_ASSISTANT_DISPLAY_NAMES) at the top of this test
module or in a test utilities module, then replace the local arrays in the tests
"bind-to-destination-006" and "bind-to-destination-011" with that constant;
ensure both tests import/use the same symbol so the list stays in sync and
update any assertions to reference the shared constant.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: e2ca9fc4-81da-4a5e-bcbc-597c636e422e

📥 Commits

Reviewing files that changed from the base of the PR and between 1926c7c and 52611ad.

📒 Files selected for processing (6)
  • packages/rangelink-vscode-extension/src/__integration-tests__/helpers/fileHelpers.ts
  • packages/rangelink-vscode-extension/src/__integration-tests__/helpers/index.ts
  • packages/rangelink-vscode-extension/src/__integration-tests__/helpers/terminalHelpers.ts
  • packages/rangelink-vscode-extension/src/__integration-tests__/suite/bindToDestination.test.ts
  • packages/rangelink-vscode-extension/src/__integration-tests__/suite/filePicker.test.ts
  • packages/rangelink-vscode-extension/src/__integration-tests__/suite/terminalPicker.test.ts

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.

Convert R-D Bind to Destination TCs to assisted mode (12 TCs)

1 participant