@@ -831,93 +831,6 @@ describe("QueryHistoryManager", () => {
831831 } ) ;
832832 } ) ;
833833
834- describe ( "determineSelection" , ( ) => {
835- const singleItem = "a" ;
836- const multipleItems = [ "b" , "c" , "d" ] ;
837-
838- it ( "should get the selection from parameters" , async ( ) => {
839- queryHistoryManager = await createMockQueryHistory ( allHistory ) ;
840- const selection = ( queryHistoryManager as any ) . determineSelection (
841- singleItem ,
842- multipleItems ,
843- ) ;
844- expect ( selection ) . toEqual ( {
845- finalSingleItem : singleItem ,
846- finalMultiSelect : multipleItems ,
847- } ) ;
848- } ) ;
849-
850- it ( "should get the selection when single selection is empty" , async ( ) => {
851- queryHistoryManager = await createMockQueryHistory ( allHistory ) ;
852- const selection = ( queryHistoryManager as any ) . determineSelection (
853- undefined ,
854- multipleItems ,
855- ) ;
856- expect ( selection ) . toEqual ( {
857- finalSingleItem : multipleItems [ 0 ] ,
858- finalMultiSelect : multipleItems ,
859- } ) ;
860- } ) ;
861-
862- it ( "should get the selection when multi-selection is empty" , async ( ) => {
863- queryHistoryManager = await createMockQueryHistory ( allHistory ) ;
864- const selection = ( queryHistoryManager as any ) . determineSelection (
865- singleItem ,
866- undefined ,
867- ) ;
868- expect ( selection ) . toEqual ( {
869- finalSingleItem : singleItem ,
870- finalMultiSelect : [ singleItem ] ,
871- } ) ;
872- } ) ;
873-
874- it ( "should get the selection from the treeView when both selections are empty" , async ( ) => {
875- queryHistoryManager = await createMockQueryHistory ( allHistory ) ;
876- const p = new Promise < void > ( ( done ) => {
877- queryHistoryManager ! . treeView . onDidChangeSelection ( ( s ) => {
878- if ( s . selection [ 0 ] !== allHistory [ 1 ] ) {
879- return ;
880- }
881- const selection = ( queryHistoryManager as any ) . determineSelection (
882- undefined ,
883- undefined ,
884- ) ;
885- expect ( selection ) . toEqual ( {
886- finalSingleItem : allHistory [ 1 ] ,
887- finalMultiSelect : [ allHistory [ 1 ] ] ,
888- } ) ;
889- done ( ) ;
890- } ) ;
891- } ) ;
892-
893- // I can't explain why, but the first time the onDidChangeSelection event fires, the selection is
894- // not correct (it is inexplicably allHistory[2]). So we fire the event a second time to get the
895- // correct selection.
896- await queryHistoryManager . treeView . reveal ( allHistory [ 0 ] , {
897- select : true ,
898- } ) ;
899- await queryHistoryManager . treeView . reveal ( allHistory [ 1 ] , {
900- select : true ,
901- } ) ;
902- await p ;
903- } ) ;
904-
905- it . skip ( "should get the selection from the treeDataProvider when both selections and the treeView are empty" , async ( ) => {
906- queryHistoryManager = await createMockQueryHistory ( allHistory ) ;
907- await queryHistoryManager . treeView . reveal ( allHistory [ 1 ] , {
908- select : true ,
909- } ) ;
910- const selection = ( queryHistoryManager as any ) . determineSelection (
911- undefined ,
912- undefined ,
913- ) ;
914- expect ( selection ) . toEqual ( {
915- finalSingleItem : allHistory [ 1 ] ,
916- finalMultiSelect : [ allHistory [ 1 ] ] ,
917- } ) ;
918- } ) ;
919- } ) ;
920-
921834 describe ( "Local Queries" , ( ) => {
922835 describe ( "findOtherQueryToCompare" , ( ) => {
923836 it ( "should find the second query to compare when one is selected" , async ( ) => {
0 commit comments