@@ -86,9 +86,12 @@ define(function (require, exports, module) {
8686 } , "search bar open" ) ;
8787 }
8888
89- function closeSearchBar ( ) {
89+ async function closeSearchBar ( ) {
9090 let $searchField = $ ( ".modal-bar #find-group textarea" ) ;
9191 SpecRunnerUtils . simulateKeyEvent ( KeyEvent . DOM_VK_ESCAPE , "keydown" , $searchField [ 0 ] ) ;
92+ await awaitsFor ( function ( ) {
93+ return $ ( ".modal-bar" ) . length === 0 ;
94+ } , "search bar close" ) ;
9295 }
9396
9497 async function executeSearch ( searchString ) {
@@ -250,12 +253,15 @@ define(function (require, exports, module) {
250253 // Error message displayed
251254 expect ( $modalBar . find ( ".scope-group div.error-filter" ) . is ( ":visible" ) ) . toBeTruthy ( ) ;
252255
253- // Search panel not showing
254- expect ( $ ( "#find-in-files-results" ) . is ( ":visible" ) ) . toBeFalsy ( ) ;
256+ // Search panel shows "no results" state
257+ expect ( $ ( "#find-in-files-results" ) . is ( ":visible" ) ) . toBeTruthy ( ) ;
255258
256259 // Close search bar
257260 let $searchField = $modalBar . find ( "#find-group textarea" ) ;
258- await SpecRunnerUtils . simulateKeyEvent ( KeyEvent . DOM_VK_ESCAPE , "keydown" , $searchField [ 0 ] ) ;
261+ SpecRunnerUtils . simulateKeyEvent ( KeyEvent . DOM_VK_ESCAPE , "keydown" , $searchField [ 0 ] ) ;
262+ await awaitsFor ( function ( ) {
263+ return $ ( ".modal-bar" ) . length === 0 ;
264+ } , "search bar close" ) ;
259265 } , 30000 ) ;
260266
261267 it ( "should respect filter when editing code" , async function ( ) {
0 commit comments