Skip to content

Commit

Permalink
attempt to stabilize hover delay test
Browse files Browse the repository at this point in the history
  • Loading branch information
johnbender committed Apr 20, 2012
1 parent c46a25e commit 147fcc4
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions tests/unit/buttonMarkup/buttonMarkup_core.js
Expand Up @@ -62,7 +62,7 @@
ok( $mini.is('.ui-mini'), "Original element has data attribute, enhanced version recieves .ui-mini." );
ok( $minicontrol.is('.ui-mini'), "Controlgroup has data attribute and recieves .ui-mini.");
});

test( "Ensure icon positioning defaults to left, and can be overridden with “data-iconpos”", function() {
var posdefault = $("#iconpos1"),
posleft = $("#iconpos2"),
Expand All @@ -80,21 +80,16 @@

var $btn = $( "#hover-delay" );

$.testHelper.sequence([
function() {
$btn.trigger( "vmousedown" );
},

function() {
$btn.trigger( "vmousedown" );

setTimeout(function() {
ok( $btn.attr("class").indexOf( "ui-btn-down" ) == -1, "button doesn't have the down class yet" );
},
}, $.mobile.buttonMarkup.hoverDelay / 2);

function() {
setTimeout(function() {
ok( $btn.attr("class").indexOf( "ui-btn-down" ) >= 0, "button has the down class yet" );
start();
}
// the value is split and some padding is added to make sure that the last check fires
// after the hoverDelay has expired
], $.mobile.buttonMarkup.hoverDelay / 2 + 50 );
}, $.mobile.buttonMarkup.hoverDelay + 100 );
});
})(jQuery);

0 comments on commit 147fcc4

Please sign in to comment.