File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
extensions/ql-vscode/test/vscode-tests/no-workspace/databases Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -246,6 +246,29 @@ describe("local-databases-ui", () => {
246246 expect ( showQuickPickSpy ) . toHaveBeenCalledTimes ( 2 ) ;
247247 expect ( handleChooseDatabaseGithubSpy ) . toHaveBeenCalledTimes ( 1 ) ;
248248 } ) ;
249+
250+ it ( "should skip straight to prompting to import a database if there are no existing databases" , async ( ) => {
251+ databaseManager . databaseItems = [ ] ;
252+
253+ const showQuickPickSpy = jest
254+ . spyOn ( window , "showQuickPick" )
255+ . mockResolvedValueOnce (
256+ mockedQuickPickItem (
257+ mockedObject < DatabaseImportQuickPickItems > ( {
258+ importType : "github" ,
259+ } ) ,
260+ ) ,
261+ ) ;
262+
263+ const handleChooseDatabaseGithubSpy = jest
264+ . spyOn ( databaseUI as any , "handleChooseDatabaseGithub" )
265+ . mockResolvedValue ( undefined ) ;
266+
267+ await databaseUI . getDatabaseItem ( progress , token ) ;
268+
269+ expect ( showQuickPickSpy ) . toHaveBeenCalledTimes ( 1 ) ;
270+ expect ( handleChooseDatabaseGithubSpy ) . toHaveBeenCalledTimes ( 1 ) ;
271+ } ) ;
249272 } ) ;
250273 } ) ;
251274
You can’t perform that action at this time.
0 commit comments