我在ui.tooltip中发现了一个错误:如果内容发生变化,工具提示会中断关闭。这是example。
请帮我做一个正确的测试,这个不时失败“工具提示太早隐藏”:
asyncTest( "content: change while close", function() {
expect( 2 );
$.fx.off = true
var tooltip,
hidingDuration = 20,
element = $( "#tooltipped1" ).tooltip({
hide: hidingDuration
});
element.tooltip( "open" );
tooltip = $( "#" + element.data( "ui-tooltip-id" ) );
$.fx.off = false;
element.tooltip( "close" );
setTimeout( function() {
ok( tooltip.is( ":visible" ), "tooltip was hidden too early" );
}, hidingDuration * 0.5 );
//element.tooltip({ content: 'Foo' });
//tooltip = $( "#" + element.data( "ui-tooltip-id" ) );
setTimeout( function() {
ok( !tooltip.is( ":visible" ), "tooltip doesn't hid properly" );
start();
}, hidingDuration * 1.5 );
});