From 4926901106181c5bc38021d2917b9f21cfbc1233 Mon Sep 17 00:00:00 2001 From: Gabriel Schulhof Date: Thu, 4 Oct 2012 13:50:40 +0300 Subject: [PATCH] [popup unit tests] Modify test that checks whether popup emits "popupafterclose" upon destroy() to first open the popup --- tests/unit/popup/popup_core.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/tests/unit/popup/popup_core.js b/tests/unit/popup/popup_core.js index f3765f98011..0dc83febfbb 100644 --- a/tests/unit/popup/popup_core.js +++ b/tests/unit/popup/popup_core.js @@ -566,16 +566,19 @@ $popup.find( "a" ).click(); }); - asyncTest( "Destroy closes the popup first", function() { + asyncTest( "Destroy closes open popup first", function() { var $popup = $( "#test-destroy-popup" ); expect( 1 ); - $popup.one( "popupafterclose", function() { - ok( true, "closed on destroy" ); - start(); - }); - - $popup.popup( "destroy" ); + $popup + .one( "popupafterclose", function() { + ok( true, "closed on destroy" ); + start(); + }) + .one( "popupafteropen", function() { + $popup.popup( "destroy" ); + }) + .popup( "open" ); }); })( jQuery );