Skip to content

Commit 4df3a59

Browse files
committed
Fix e2e tests
1 parent d405170 commit 4df3a59

File tree

8 files changed

+56
-13
lines changed

8 files changed

+56
-13
lines changed

e2e/package-lock.json

Lines changed: 21 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

e2e/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
"build": "rimraf out && tsc -p tsconfig.json",
1111
"vscode-test": "cd .. && npm run vscode-test"
1212
},
13-
"dependencies": {},
1413
"devDependencies": {
14+
"@roo-code/types": "^1.12.0",
1515
"@types/mocha": "^10.0.10",
1616
"@vscode/test-cli": "^0.0.10",
1717
"@vscode/test-electron": "^2.4.0",

e2e/src/suite/extension.test.ts

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,47 @@
11
import * as assert from "assert"
22
import * as vscode from "vscode"
33

4+
import { Package } from "@roo-code/types"
5+
46
suite("Roo Code Extension", () => {
57
test("Commands should be registered", async () => {
68
const expectedCommands = [
9+
"SidebarProvider.open",
10+
"SidebarProvider.focus",
11+
"SidebarProvider.resetViewLocation",
12+
"SidebarProvider.toggleVisibility",
13+
"SidebarProvider.removeView",
14+
"activationCompleted",
715
"plusButtonClicked",
816
"mcpButtonClicked",
9-
"historyButtonClicked",
17+
"promptsButtonClicked",
1018
"popoutButtonClicked",
11-
"settingsButtonClicked",
1219
"openInNewTab",
20+
"settingsButtonClicked",
21+
"historyButtonClicked",
22+
"showHumanRelayDialog",
23+
"registerHumanRelayCallback",
24+
"unregisterHumanRelayCallback",
25+
"handleHumanRelayResponse",
26+
"newTask",
27+
"setCustomStoragePath",
28+
"focusInput",
29+
"acceptInput",
1330
"explainCode",
1431
"fixCode",
1532
"improveCode",
33+
"addToContext",
34+
"terminalAddToContext",
35+
"terminalFixCommand",
36+
"terminalExplainCommand",
1637
]
1738

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+
)
1942

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`)
2345
}
2446
})
2547
})

e2e/src/suite/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import Mocha from "mocha"
33
import { glob } from "glob"
44
import * as vscode from "vscode"
55

6-
import { type RooCodeAPI, Package } from "../../../src/exports/roo-code"
6+
import { type RooCodeAPI, Package } from "@roo-code/types"
77

88
import { waitFor } from "./utils"
99

@@ -26,7 +26,7 @@ export async function run() {
2626
openRouterModelId: "google/gemini-2.0-flash-001",
2727
})
2828

29-
await vscode.commands.executeCommand(`${Package.publisher}.SidebarProvider.focus`)
29+
await vscode.commands.executeCommand(`${Package.name}.SidebarProvider.focus`)
3030
await waitFor(() => api.isReady())
3131

3232
// Expose the API to the tests.

e2e/src/suite/modes.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as assert from "assert"
22

3-
import type { ClineMessage } from "../../../src/exports/roo-code"
3+
import type { ClineMessage } from "@roo-code/types"
44

55
import { waitUntilCompleted } from "./utils"
66

e2e/src/suite/subtasks.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as assert from "assert"
22

3-
import type { ClineMessage } from "../../../src/exports/roo-code"
3+
import type { ClineMessage } from "@roo-code/types"
44

55
import { sleep, waitFor, waitUntilCompleted } from "./utils"
66

e2e/src/suite/task.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as assert from "assert"
22

3-
import type { ClineMessage } from "../../../src/exports/roo-code"
3+
import type { ClineMessage } from "@roo-code/types"
44

55
import { waitUntilCompleted } from "./utils"
66

e2e/src/suite/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { RooCodeAPI } from "../../../src/exports/roo-code"
1+
import type { RooCodeAPI } from "@roo-code/types"
22

33
type WaitForOptions = {
44
timeout?: number

0 commit comments

Comments
 (0)