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", () => {
246
246
expect ( showQuickPickSpy ) . toHaveBeenCalledTimes ( 2 ) ;
247
247
expect ( handleChooseDatabaseGithubSpy ) . toHaveBeenCalledTimes ( 1 ) ;
248
248
} ) ;
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
+ } ) ;
249
272
} ) ;
250
273
} ) ;
251
274
You can’t perform that action at this time.
0 commit comments