From 834220ea20ce5b7cd31edfb624a28b4bf8b29a6a Mon Sep 17 00:00:00 2001 From: fat Date: Sat, 3 Jan 2015 13:58:44 -0800 Subject: bootstrap onto closure --- js/tests/unit/tooltip.js | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'js/tests/unit/tooltip.js') diff --git a/js/tests/unit/tooltip.js b/js/tests/unit/tooltip.js index 20efff8cc0..2b63a3b48c 100644 --- a/js/tests/unit/tooltip.js +++ b/js/tests/unit/tooltip.js @@ -30,7 +30,7 @@ $(function () { }) test('should expose default settings', function () { - ok($.fn.bootstrapTooltip.Constructor.DEFAULTS, 'defaults is defined') + ok($.fn.bootstrapTooltip.Constructor.Defaults, 'defaults is defined') }) test('should empty title attribute', function () { @@ -879,17 +879,17 @@ $(function () { .bootstrapTooltip({ delay: { show: 0, hide: 150 }}) setTimeout(function () { - ok($tooltip.data('bs.tooltip').$tip.is('.fade.in'), '1ms: tooltip faded in') + ok($('.tooltip').is('.fade.in'), '1ms: tooltip faded in') $tooltip.trigger('mouseout') setTimeout(function () { - ok($tooltip.data('bs.tooltip').$tip.is('.fade.in'), '100ms: tooltip still faded in') + ok($('.tooltip').is('.fade.in'), '100ms: tooltip still faded in') }, 100) setTimeout(function () { - ok(!$tooltip.data('bs.tooltip').$tip.is('.in'), '200ms: tooltip removed') - done() + ok(!$('.tooltip').is('.in'), '200ms: tooltip removed') + start() }, 200) }, 0) @@ -978,7 +978,7 @@ $(function () { test('should not reload the tooltip on subsequent mouseenter events', function () { var titleHtml = function () { - var uid = $.fn.bootstrapTooltip.Constructor.prototype.getUID('tooltip') + var uid = 'fatTooltip' return '

' + uid + '

' + uid + '

' + uid + '

' } @@ -1004,7 +1004,7 @@ $(function () { test('should not reload the tooltip if the mouse leaves and re-enters before hiding', function () { var titleHtml = function () { - var uid = $.fn.bootstrapTooltip.Constructor.prototype.getUID('tooltip') + var uid = 'fatTooltip' return '

' + uid + '

' + uid + '

' + uid + '

' } @@ -1029,10 +1029,12 @@ $(function () { $('#tt-outer').trigger('mouseleave') equal(currentUid, $('#tt-content').text()) - ok(obj.hoverState == 'out', 'the tooltip hoverState should be set to "out"') + debugger + + ok(obj.getHoverState() == 'out', 'the tooltip hoverState should be set to "out"') $('#tt-content').trigger('mouseenter') - ok(obj.hoverState == 'in', 'the tooltip hoverState should be set to "in"') + ok(obj.getHoverState() == 'in', 'the tooltip hoverState should be set to "in"') equal(currentUid, $('#tt-content').text()) }) @@ -1051,7 +1053,7 @@ $(function () { $('Foobar') .appendTo('body') .on('shown.bs.tooltip', function () { - var arrowStyles = $(this).data('bs.tooltip').$tip.find('.tooltip-arrow').attr('style') + var arrowStyles = $('.tooltip').find('.tooltip-arrow').attr('style') ok(/left/i.test(arrowStyles) && !/top/i.test(arrowStyles), 'arrow positioned correctly') $(this).bootstrapTooltip('hide') }) -- cgit v1.2.3