|
1 | 1 | import * as assert from "assert" |
2 | 2 | import * as vscode from "vscode" |
3 | 3 |
|
| 4 | +import { Package } from "@roo-code/types" |
| 5 | + |
4 | 6 | suite("Roo Code Extension", () => { |
5 | 7 | test("Commands should be registered", async () => { |
6 | 8 | const expectedCommands = [ |
| 9 | + "SidebarProvider.open", |
| 10 | + "SidebarProvider.focus", |
| 11 | + "SidebarProvider.resetViewLocation", |
| 12 | + "SidebarProvider.toggleVisibility", |
| 13 | + "SidebarProvider.removeView", |
| 14 | + "activationCompleted", |
7 | 15 | "plusButtonClicked", |
8 | 16 | "mcpButtonClicked", |
9 | | - "historyButtonClicked", |
| 17 | + "promptsButtonClicked", |
10 | 18 | "popoutButtonClicked", |
11 | | - "settingsButtonClicked", |
12 | 19 | "openInNewTab", |
| 20 | + "settingsButtonClicked", |
| 21 | + "historyButtonClicked", |
| 22 | + "showHumanRelayDialog", |
| 23 | + "registerHumanRelayCallback", |
| 24 | + "unregisterHumanRelayCallback", |
| 25 | + "handleHumanRelayResponse", |
| 26 | + "newTask", |
| 27 | + "setCustomStoragePath", |
| 28 | + "focusInput", |
| 29 | + "acceptInput", |
13 | 30 | "explainCode", |
14 | 31 | "fixCode", |
15 | 32 | "improveCode", |
| 33 | + "addToContext", |
| 34 | + "terminalAddToContext", |
| 35 | + "terminalFixCommand", |
| 36 | + "terminalExplainCommand", |
16 | 37 | ] |
17 | 38 |
|
18 | | - const commands = await vscode.commands.getCommands(true) |
| 39 | + const commands = new Set( |
| 40 | + (await vscode.commands.getCommands(true)).filter((cmd) => cmd.startsWith(Package.name)), |
| 41 | + ) |
19 | 42 |
|
20 | | - for (const cmd of expectedCommands) { |
21 | | - const [_prefix, command] = cmd.split(".") |
22 | | - assert.ok(commands.includes(command), `Command ${command} should be registered`) |
| 43 | + for (const command of expectedCommands) { |
| 44 | + assert.ok(commands.has(`${Package.name}.${command}`), `Command ${command} should be registered`) |
23 | 45 | } |
24 | 46 | }) |
25 | 47 | }) |
0 commit comments