Skip to content

Commit 948f874

Browse files
committed
Button tests: Work around a quirk in Opera.
1 parent 37ea734 commit 948f874

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

tests/unit/button/button_core.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,24 @@ test("buttonset (rtl)", function() {
9292
// remove this when simulate properly simulates this
9393
// see http://yuilibrary.com/projects/yui2/ticket/2528826 fore more info
9494
if ( !$.ui.ie || ( document.documentMode && document.documentMode > 8 ) ) {
95-
test( "ensure checked and aria after single click on checkbox label button, see #5518", function() {
95+
asyncTest( "ensure checked and aria after single click on checkbox label button, see #5518", function() {
9696
expect( 3 );
9797

9898
$("#check2").button().change( function() {
9999
var lbl = $( this ).button("widget");
100100
ok( this.checked, "checked ok" );
101101
ok( lbl.attr("aria-pressed") === "true", "aria ok" );
102102
ok( lbl.hasClass("ui-state-active"), "ui-state-active ok" );
103-
}).button("widget").simulate("mousedown").simulate("click").simulate("mouseup");
103+
});
104+
105+
// support: Opera
106+
// Opera doesn't trigger a change event when this is done synchronously.
107+
// This seems to be a side effect of another test, but until that can be
108+
// tracked down, this delay will have to do.
109+
setTimeout(function() {
110+
$("#check2").button("widget").simulate("click");
111+
start();
112+
}, 1 );
104113
});
105114
}
106115

0 commit comments

Comments
 (0)