Permalink
Browse files

[popup unit tests] Modify test that checks whether popup emits "popup…

…afterclose" upon destroy() to first open the popup
  • Loading branch information...
1 parent 0586202 commit ea768cb34d06bbd3a4e1f9834348704cc544f161 @gabrielschulhof gabrielschulhof committed Oct 4, 2012
Showing with 10 additions and 7 deletions.
  1. +10 −7 tests/unit/popup/popup_core.js
@@ -463,16 +463,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 );

0 comments on commit ea768cb

Please sign in to comment.