File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed
Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -653,6 +653,21 @@ describe("dataSourceCommand2", () => {
653653 ext . isResultsTabVisible = false ;
654654 } ) ;
655655
656+ it ( "should not proceed there is no connection selected" , async ( ) => {
657+ ext . activeConnection = undefined ;
658+ await dataSourceCommand . runDataSource (
659+ { } as DataSourceFiles ,
660+ "" ,
661+ "test-file.kdb.json" ,
662+ ) ;
663+ windowMock
664+ . expects ( "showInformationMessage" )
665+ . once ( )
666+ . withArgs (
667+ "You didn't selected any existing connection to execute this action, please select a connection and try again." ,
668+ ) ;
669+ } ) ;
670+
656671 it ( "should show an error message if not connected to an Insights server" , async ( ) => {
657672 ext . activeConnection = undefined ;
658673 getMetaStub . resolves ( { } ) ;
Original file line number Diff line number Diff line change @@ -366,6 +366,20 @@ describe("Utils", () => {
366366 assert . ok ( stub . calledOnce ) ;
367367 } ) ;
368368 } ) ;
369+
370+ describe ( "noSelectedConnectionAction" , ( ) => {
371+ afterEach ( ( ) => {
372+ sinon . restore ( ) ;
373+ } ) ;
374+
375+ it ( "should call showInformationMessage" , ( ) => {
376+ const stub = sinon
377+ . stub ( vscode . window , "showInformationMessage" )
378+ . resolves ( ) ;
379+ coreUtils . noSelectedConnectionAction ( ) ;
380+ assert . ok ( stub . calledOnce ) ;
381+ } ) ;
382+ } ) ;
369383 } ) ;
370384
371385 describe ( "dataSource" , ( ) => {
You can’t perform that action at this time.
0 commit comments