2

我在 ui.tooltip 中发现了一个错误:如果其内容发生变化,工具提示会中断关闭。这是示例

请帮助我进行适当的测试,这个有时会在“工具提示被隐藏得太早”上失败:

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 );
});
4

0 回答 0