mirror of
https://github.com/jquery/jquery-ui.git
synced 2025-01-07 20:34:24 +00:00
Calendar tests: Simplify timeout steps
This commit is contained in:
parent
9fc83a085c
commit
96b5a760c4
@ -69,32 +69,26 @@ asyncTest( "select", function() {
|
|||||||
} );
|
} );
|
||||||
|
|
||||||
function step1() {
|
function step1() {
|
||||||
setTimeout( function() {
|
|
||||||
eventType = "mousedown";
|
eventType = "mousedown";
|
||||||
message = "on calendar button " + eventType;
|
message = "on calendar button " + eventType;
|
||||||
that.element.find( "table button:eq(1)" ).simulate( eventType );
|
that.element.find( "table button:eq(1)" ).simulate( eventType );
|
||||||
step2();
|
setTimeout( step2, 50 );
|
||||||
}, 50 );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function step2() {
|
function step2() {
|
||||||
setTimeout( function() {
|
|
||||||
eventType = "keydown";
|
eventType = "keydown";
|
||||||
message = "on calendar button " + eventType;
|
message = "on calendar button " + eventType;
|
||||||
testHelper.focusGrid( that.element )
|
testHelper.focusGrid( that.element )
|
||||||
.simulate( eventType, { keyCode: $.ui.keyCode.END } )
|
.simulate( eventType, { keyCode: $.ui.keyCode.END } )
|
||||||
.simulate( eventType, { keyCode: $.ui.keyCode.ENTER } );
|
.simulate( eventType, { keyCode: $.ui.keyCode.ENTER } );
|
||||||
step3();
|
setTimeout( step3, 50 );
|
||||||
}, 50 );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// This should not trigger another event
|
// This should not trigger another event
|
||||||
function step3() {
|
function step3() {
|
||||||
setTimeout( function() {
|
|
||||||
that.element.calendar( "disable" );
|
that.element.calendar( "disable" );
|
||||||
that.element.find( "table button:eq(10)" ).simulate( "mousedown" );
|
that.element.find( "table button:eq(10)" ).simulate( "mousedown" );
|
||||||
start();
|
setTimeout( start, 50 );
|
||||||
}, 50 );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
step1();
|
step1();
|
||||||
|
Loading…
Reference in New Issue
Block a user