Skip to content

Commit c885d8c

Browse files
committed
fix: allow device registry unit test to run even if command has already been registered
1 parent 41b9549 commit c885d8c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/askContainer/commands/deviceRegistryCommand.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ import {DeviceRegistryWebview} from "../webViews/deviceRegistryWebview";
1212
export class DeviceRegistryCommand extends AbstractCommand<void> {
1313
private deviceRegistryWebview: DeviceRegistryWebview;
1414

15-
constructor(webview: DeviceRegistryWebview) {
16-
super("askContainer.skillsConsole.deviceRegistry");
15+
constructor(webview: DeviceRegistryWebview, commandOverride?: string) {
16+
super(commandOverride ?? "askContainer.skillsConsole.deviceRegistry");
1717
this.deviceRegistryWebview = webview;
1818
}
1919

test/askContainer/commands/deviceRegistry.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ describe("Command askContainer.skillsConsole.deviceRegistry", () => {
2828

2929
it("Should show the view when executed", async () => {
3030
const showViewSpy = sinon.spy();
31-
command = new DeviceRegistryCommand({showView: showViewSpy} as any);
3231

32+
command = new DeviceRegistryCommand({showView: showViewSpy} as any, "askContainer.skillsConsole.deviceRegistryTest");
3333
/*
3434
undefined argument due to
3535
@@ -38,7 +38,7 @@ describe("Command askContainer.skillsConsole.deviceRegistry", () => {
3838
and passes that as a parameter when invoking the command.
3939
4040
*/
41-
await vscode.commands.executeCommand("askContainer.skillsConsole.deviceRegistry", undefined);
41+
await vscode.commands.executeCommand("askContainer.skillsConsole.deviceRegistryTest", undefined);
4242

4343
assert.ok(showViewSpy.called);
4444
});

0 commit comments

Comments
 (0)