File tree Expand file tree Collapse file tree 2 files changed +9
-24
lines changed
test/vscode-tests/no-workspace/query-history Expand file tree Collapse file tree 2 files changed +9
-24
lines changed Original file line number Diff line number Diff line change @@ -279,7 +279,10 @@ export class QueryHistoryManager extends DisposableObject {
279279 "codeQLQueryHistory.cancel" : createMultiSelectionCommand (
280280 this . handleCancel . bind ( this ) ,
281281 ) ,
282- "codeQLQueryHistory.exportResults" : this . handleExportResults . bind ( this ) ,
282+ "codeQLQueryHistory.exportResults" : createSingleSelectionCommand (
283+ this . handleExportResults . bind ( this ) ,
284+ "query" ,
285+ ) ,
283286 "codeQLQueryHistory.viewCsvResults" : createSingleSelectionCommand (
284287 this . handleViewCsvResults . bind ( this ) ,
285288 "query" ,
@@ -934,21 +937,12 @@ export class QueryHistoryManager extends DisposableObject {
934937 ) ;
935938 }
936939
937- async handleExportResults (
938- singleItem : QueryHistoryInfo ,
939- multiSelect : QueryHistoryInfo [ ] | undefined ,
940- ) : Promise < void > {
941- // Variant analysis only
942- if (
943- ! this . assertSingleQuery ( multiSelect ) ||
944- singleItem . t !== "variant-analysis"
945- ) {
940+ async handleExportResults ( item : QueryHistoryInfo ) : Promise < void > {
941+ if ( item . t !== "variant-analysis" ) {
946942 return ;
947943 }
948944
949- await this . variantAnalysisManager . exportResults (
950- singleItem . variantAnalysis . id ,
951- ) ;
945+ await this . variantAnalysisManager . exportResults ( item . variantAnalysis . id ) ;
952946 }
953947
954948 /**
Original file line number Diff line number Diff line change @@ -726,7 +726,7 @@ describe("QueryHistoryManager", () => {
726726 queryHistoryManager = await createMockQueryHistory ( localQueryHistory ) ;
727727
728728 const item = localQueryHistory [ 4 ] ;
729- await queryHistoryManager . handleExportResults ( item , [ item ] ) ;
729+ await queryHistoryManager . handleExportResults ( item ) ;
730730
731731 expect ( variantAnalysisManagerStub . exportResults ) . not . toBeCalled ( ) ;
732732 } ) ;
@@ -735,20 +735,11 @@ describe("QueryHistoryManager", () => {
735735 queryHistoryManager = await createMockQueryHistory ( allHistory ) ;
736736
737737 const item = variantAnalysisHistory [ 1 ] ;
738- await queryHistoryManager . handleExportResults ( item , [ item ] ) ;
738+ await queryHistoryManager . handleExportResults ( item ) ;
739739 expect ( variantAnalysisManagerStub . exportResults ) . toBeCalledWith (
740740 item . variantAnalysis . id ,
741741 ) ;
742742 } ) ;
743-
744- it ( "should not export results for multiple variant analyses" , async ( ) => {
745- queryHistoryManager = await createMockQueryHistory ( allHistory ) ;
746-
747- const item1 = variantAnalysisHistory [ 1 ] ;
748- const item2 = variantAnalysisHistory [ 3 ] ;
749- await queryHistoryManager . handleExportResults ( item1 , [ item1 , item2 ] ) ;
750- expect ( variantAnalysisManagerStub . exportResults ) . not . toBeCalled ( ) ;
751- } ) ;
752743 } ) ;
753744
754745 describe ( "Local Queries" , ( ) => {
You can’t perform that action at this time.
0 commit comments