Skip to content
This repository was archived by the owner on Oct 8, 2021. It is now read-only.

Commit 4926901

Browse files
author
Gabriel Schulhof
committed
[popup unit tests] Modify test that checks whether popup emits "popupafterclose" upon destroy() to first open the popup
1 parent 616ae09 commit 4926901

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

tests/unit/popup/popup_core.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -566,16 +566,19 @@
566566
$popup.find( "a" ).click();
567567
});
568568

569-
asyncTest( "Destroy closes the popup first", function() {
569+
asyncTest( "Destroy closes open popup first", function() {
570570
var $popup = $( "#test-destroy-popup" );
571571

572572
expect( 1 );
573573

574-
$popup.one( "popupafterclose", function() {
575-
ok( true, "closed on destroy" );
576-
start();
577-
});
578-
579-
$popup.popup( "destroy" );
574+
$popup
575+
.one( "popupafterclose", function() {
576+
ok( true, "closed on destroy" );
577+
start();
578+
})
579+
.one( "popupafteropen", function() {
580+
$popup.popup( "destroy" );
581+
})
582+
.popup( "open" );
580583
});
581584
})( jQuery );

0 commit comments

Comments
 (0)