Skip to content

Commit 37ea734

Browse files
committed
Button tests: simulated clicks aren't perfect in oldIE and Opera
1 parent dec8445 commit 37ea734

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

tests/unit/button/button_core.js

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,20 @@ test("buttonset (rtl)", function() {
8888
ok( set.children("label:eq(2)").is(".ui-button.ui-corner-left:not(.ui-corner-all)") );
8989
});
9090

91-
test( "ensure checked and aria after single click on checkbox label button, see #5518", function() {
92-
expect( 3 );
93-
94-
$("#check2").button().change( function() {
95-
var lbl = $( this ).button("widget");
96-
ok( this.checked, "checked ok" );
97-
ok( lbl.attr("aria-pressed") === "true", "aria ok" );
98-
ok( lbl.hasClass("ui-state-active"), "ui-state-active ok" );
99-
}).button("widget").simulate("click");
100-
});
91+
// TODO: simulated click events don't behave like real click events in IE
92+
// remove this when simulate properly simulates this
93+
// see http://yuilibrary.com/projects/yui2/ticket/2528826 fore more info
94+
if ( !$.ui.ie || ( document.documentMode && document.documentMode > 8 ) ) {
95+
test( "ensure checked and aria after single click on checkbox label button, see #5518", function() {
96+
expect( 3 );
97+
98+
$("#check2").button().change( function() {
99+
var lbl = $( this ).button("widget");
100+
ok( this.checked, "checked ok" );
101+
ok( lbl.attr("aria-pressed") === "true", "aria ok" );
102+
ok( lbl.hasClass("ui-state-active"), "ui-state-active ok" );
103+
}).button("widget").simulate("mousedown").simulate("click").simulate("mouseup");
104+
});
105+
}
101106

102107
})(jQuery);

0 commit comments

Comments
 (0)