1- import { commands , window } from "vscode" ;
1+ import { window } from "vscode" ;
22
33import { readJson } from "fs-extra" ;
44import * as path from "path" ;
@@ -15,11 +15,14 @@ import { createDbTreeViewItemSystemDefinedList } from "../../../../src/databases
1515import { createRemoteSystemDefinedListDbItem } from "../../../factories/db-item-factories" ;
1616import { DbConfigStore } from "../../../../src/databases/config/db-config-store" ;
1717import { getActivatedExtension } from "../../global.helper" ;
18+ import { createVSCodeCommandManager } from "../../../../src/common/vscode/commands" ;
19+ import { AllCommands } from "../../../../src/common/commands" ;
1820
1921jest . setTimeout ( 60_000 ) ;
2022
2123describe ( "Db panel UI commands" , ( ) => {
2224 let storagePath : string ;
25+ const commandManager = createVSCodeCommandManager < AllCommands > ( ) ;
2326
2427 beforeEach ( async ( ) => {
2528 const extension = await getActivatedExtension ( ) ;
@@ -31,7 +34,7 @@ describe("Db panel UI commands", () => {
3134 it ( "should add new remote db list" , async ( ) => {
3235 // Add db list
3336 jest . spyOn ( window , "showInputBox" ) . mockResolvedValue ( "my-list-1" ) ;
34- await commands . executeCommand (
37+ await commandManager . execute (
3538 "codeQLVariantAnalysisRepositories.addNewList" ,
3639 ) ;
3740
@@ -53,7 +56,7 @@ describe("Db panel UI commands", () => {
5356 kind : DbListKind . Local ,
5457 } as AddListQuickPickItem ) ;
5558 jest . spyOn ( window , "showInputBox" ) . mockResolvedValue ( "my-list-1" ) ;
56- await commands . executeCommand (
59+ await commandManager . execute (
5760 "codeQLVariantAnalysisRepositories.addNewList" ,
5861 ) ;
5962
@@ -74,7 +77,7 @@ describe("Db panel UI commands", () => {
7477 } as RemoteDatabaseQuickPickItem ) ;
7578
7679 jest . spyOn ( window , "showInputBox" ) . mockResolvedValue ( "owner1/repo1" ) ;
77- await commands . executeCommand (
80+ await commandManager . execute (
7881 "codeQLVariantAnalysisRepositories.addNewDatabase" ,
7982 ) ;
8083
@@ -97,7 +100,7 @@ describe("Db panel UI commands", () => {
97100 } as RemoteDatabaseQuickPickItem ) ;
98101
99102 jest . spyOn ( window , "showInputBox" ) . mockResolvedValue ( "owner1" ) ;
100- await commands . executeCommand (
103+ await commandManager . execute (
101104 "codeQLVariantAnalysisRepositories.addNewDatabase" ,
102105 ) ;
103106
@@ -119,7 +122,7 @@ describe("Db panel UI commands", () => {
119122 "tooltip" ,
120123 ) ;
121124
122- await commands . executeCommand (
125+ await commandManager . execute (
123126 "codeQLVariantAnalysisRepositories.setSelectedItemContextMenu" ,
124127 treeViewItem ,
125128 ) ;
0 commit comments