Skip to content

Commit b69b430

Browse files
author
Gabriel Schulhof
committed
Tests: Unit: Popup: Make sure closed popup is not :visible and that open popup is :visible. Tests jquery-archive#5892.
1 parent 985771b commit b69b430

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tests/unit/popup/popup_core.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,11 @@
125125
var $popup = $( "#test-popup" ),
126126
link = $( "a#open-test-popup" )[ 0 ];
127127

128-
expect( 14 );
128+
expect( 17 );
129129

130130
$.testHelper.detailedEventCascade([
131131
function() {
132+
deepEqual( $( "#test-popup-popup:visible" ).length, 0, "Test popup is not initially :visible" );
132133
deepEqual( $.mobile.getAttribute( link, "aria-haspopup" ), true, "'aria-haspopup' attribute is set to true on link that opens the popup" );
133134
deepEqual( $.mobile.getAttribute( link, "aria-owns" ), "#test-popup", "'aria-owns' attribute is set to the ID of the owned popup ('#test-popup')" );
134135
deepEqual( $.mobile.getAttribute( link, "aria-expanded" ), false, "'aria-expanded' attribute is set to false when the popup is not open" );
@@ -143,6 +144,7 @@
143144
function( result ) {
144145
var theOffset = $( "#test-popup p" ).offset();
145146

147+
deepEqual( $( "#test-popup-popup:visible" ).length, 1, "Test popup is :visible when open" );
146148
deepEqual( $.mobile.getAttribute( link, "aria-expanded" ), true, "'aria-expanded' attribute is set to true when the popup is open" );
147149
ok( !$popup.parent().prev().hasClass( "ui-screen-hidden" ), "Open popup screen is not hidden" );
148150
ok( $popup.attr( "class" ).match( /( |^)ui-body-[a-z]( |$)/ ), "Open popup has a valid overlay theme" );
@@ -162,6 +164,7 @@
162164
},
163165

164166
function( result) {
167+
deepEqual( $( "#test-popup-popup:visible" ).length, 0, "Test popup is not :visible after it is closed" );
165168
deepEqual( $.mobile.getAttribute( link, "aria-expanded" ), false, "'aria-expanded' attribute is set to false when the popup is not open" );
166169
ok( !$popup.parent().hasClass( "in" ), "Closed popup container does not have class 'in'" );
167170
ok( $popup.parent().prev().hasClass( "ui-screen-hidden" ), "Closed popup screen is hidden" );

0 commit comments

Comments
 (0)