@@ -136,6 +136,12 @@ define(function (require, exports, module) {
136136 } , "indexing complete" , 20000 ) ;
137137 var $searchField = $ ( "#find-what" ) ;
138138 FindInFiles . _searchDone = false ;
139+ // if the search str is same as previous string, fif will not do any search as its already loaded
140+ $searchField . val ( "another_str_to_trigger_fif" ) . trigger ( "input" ) ;
141+ await awaitsFor ( function ( ) {
142+ return FindInFiles . _searchDone ;
143+ } , "Find in Files done" ) ;
144+ FindInFiles . _searchDone = false ;
139145 $searchField . val ( searchString ) . trigger ( "input" ) ;
140146 await awaitsFor ( function ( ) {
141147 return FindInFiles . _searchDone ;
@@ -549,11 +555,17 @@ define(function (require, exports, module) {
549555 expect ( Object . keys ( FindInFiles . searchModel . results ) . length ) . not . toBe ( 0 ) ;
550556
551557 await closeSearchBar ( ) ;
552- await openSearchBar ( fileEntry ) ;
553558
554- // Search model shouldn't be cleared from merely reopening search bar
559+ // Search model shouldn't be cleared after search bar closed
555560 expect ( Object . keys ( FindInFiles . searchModel . results ) . length ) . not . toBe ( 0 ) ;
556561
562+ await openSearchBar ( fileEntry ) ;
563+ // opening searchbar will also trigger a search with last searched string
564+
565+ await awaitsFor ( function ( ) {
566+ return Object . keys ( FindInFiles . searchModel . results ) . length ;
567+ } , "waiting for search results to be there" ) ;
568+
557569 await closeSearchBar ( ) ;
558570
559571 // Search model shouldn't be cleared after search bar closed without running a search
0 commit comments