Roo-Code/test_fix_summary.md
hannesrudolph 70ca7a6cae refactor: move command whitelisting from VS Code settings to plugin UI
- Removed 'roo-code.commandWhitelist' from VS Code settings (package.json)
- Added command whitelisting to Auto Approve settings in plugin UI
- Migrated existing whitelist settings to new location on extension activation
- Updated all related components, tests, and localization files
- Maintains backward compatibility by migrating existing settings

This change improves user experience by consolidating all auto-approval
settings in one location within the plugin's settings interface.
2025-07-15 11:58:20 -06:00

1.5 KiB

Test Fix Summary

Issue

The tests in webview-ui/src/components/chat/__tests__/CommandExecution.spec.tsx were failing because they were looking for the text "Add to Allowed Auto-Execute Commands" but the component had been updated to use "Manage Command Permissions".

Changes Made

1. Updated Translation Key References

  • Changed all mock translation key references from chat:commandExecution.addToAllowedCommands to chat:commandExecution.manageCommands
  • Updated the returned text from "Add to Allowed Auto-Execute Patterns" to "Manage Command Permissions"

2. Updated Test Assertions

  • Replaced all occurrences of "Add to Allowed Auto-Execute Patterns" with "Manage Command Permissions" in test assertions
  • This affected 15 different test cases

3. Updated Component Structure Tests

  • The component structure changed from using checkboxes to using action buttons (Check and X icons)
  • Updated tests to look for buttons with specific aria-labels instead of checkboxes
  • Updated button count expectations to account for 2 buttons per pattern (allow and deny)

4. Fixed Mock Setup

  • Added missing mock functions (setAllowedCommands and setDeniedCommands) to the useExtensionState mock
  • Added deniedCommands array to the mock state

Test Results

  • All 13 tests in CommandExecution.spec.tsx now pass
  • All 654 tests in webview-ui pass
  • All 2884 tests in the backend pass

Files Modified

  • webview-ui/src/components/chat/__tests__/CommandExecution.spec.tsx