From 667179f406ea66fbe2d688bb132eaa0c0f7383a6 Mon Sep 17 00:00:00 2001 From: Jacob Thornton Date: Thu, 20 Sep 2012 16:23:54 -0700 Subject: added support for jquery 1.8.* --- js/tests/unit/bootstrap-tooltip.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'js/tests/unit/bootstrap-tooltip.js') diff --git a/js/tests/unit/bootstrap-tooltip.js b/js/tests/unit/bootstrap-tooltip.js index 9844d6460..14d6b2274 100644 --- a/js/tests/unit/bootstrap-tooltip.js +++ b/js/tests/unit/bootstrap-tooltip.js @@ -113,7 +113,7 @@ $(function () { }, 50) }) - test("should show tooltip if leave event hasn't occurred before delay expires", function () { + test("should show tooltip if leave event hasn't occured before delay expires", function () { var tooltip = $('') .appendTo('#qunit-fixture') .tooltip({ delay: 150 }) @@ -131,14 +131,14 @@ $(function () { test("should destroy tooltip", function () { var tooltip = $('
').tooltip().on('click.foo', function(){}) ok(tooltip.data('tooltip'), 'tooltip has data') - ok(tooltip.data('events').mouseover && tooltip.data('events').mouseout, 'tooltip has hover event') - ok(tooltip.data('events').click[0].namespace == 'foo', 'tooltip has extra click.foo event') + ok($._data(tooltip[0], 'events').mouseover && $._data(tooltip[0], 'events').mouseout, 'tooltip has hover event') + ok($._data(tooltip[0], 'events').click[0].namespace == 'foo', 'tooltip has extra click.foo event') tooltip.tooltip('show') tooltip.tooltip('destroy') ok(!tooltip.hasClass('in'), 'tooltip is hidden') - ok(!tooltip.data('tooltip'), 'tooltip does not have data') - ok(tooltip.data('events').click[0].namespace == 'foo', 'tooltip still has click.foo') - ok(!tooltip.data('events').mouseover && !tooltip.data('events').mouseout, 'tooltip does not have any events') + ok(!$._data(tooltip[0], 'tooltip'), 'tooltip does not have data') + ok($._data(tooltip[0], 'events').click[0].namespace == 'foo', 'tooltip still has click.foo') + ok(!$._data(tooltip[0], 'events').mouseover && !$._data(tooltip[0], 'events').mouseout, 'tooltip does not have any events') }) -}) +}) \ No newline at end of file -- cgit v1.2.3 From 003fcccceb869ac0420d542bac9860f5f32e68a1 Mon Sep 17 00:00:00 2001 From: Jacob Thornton Date: Mon, 24 Sep 2012 23:15:36 -0700 Subject: change tooltip/popover html default to false for xss safety net --- js/tests/unit/bootstrap-tooltip.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'js/tests/unit/bootstrap-tooltip.js') diff --git a/js/tests/unit/bootstrap-tooltip.js b/js/tests/unit/bootstrap-tooltip.js index 14d6b2274..964ba1ef2 100644 --- a/js/tests/unit/bootstrap-tooltip.js +++ b/js/tests/unit/bootstrap-tooltip.js @@ -37,10 +37,11 @@ $(function () { tooltip.tooltip('hide') }) - test("should always allow html entities", function () { + test("should allow html entities", function () { $.support.transition = false var tooltip = $('') .appendTo('#qunit-fixture') + .tooltip({html: true}) .tooltip('show') ok($('.tooltip b').length, 'b tag was inserted') -- cgit v1.2.3 From 6b017b9bea37629d0ee9bcd99e8e34b91aa3b5c0 Mon Sep 17 00:00:00 2001 From: Martin Stein Date: Mon, 15 Oct 2012 15:17:59 +0200 Subject: fixed reference to this.tip() so it works in delegate events --- js/tests/unit/bootstrap-tooltip.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'js/tests/unit/bootstrap-tooltip.js') diff --git a/js/tests/unit/bootstrap-tooltip.js b/js/tests/unit/bootstrap-tooltip.js index 964ba1ef2..bbdf3ce80 100644 --- a/js/tests/unit/bootstrap-tooltip.js +++ b/js/tests/unit/bootstrap-tooltip.js @@ -142,4 +142,12 @@ $(function () { ok(!$._data(tooltip[0], 'events').mouseover && !$._data(tooltip[0], 'events').mouseout, 'tooltip does not have any events') }) + test("should show tooltip with delegate selector on click", function () { + var div = $('
') + var tooltip = div.appendTo('#qunit-fixture') + .tooltip({ selector: 'a[rel=tooltip]', + trigger: 'click' }) + div.find('a').trigger('click') + ok($(".tooltip").is('.fade.in'), 'tooltip is faded in') + }) }) \ No newline at end of file -- cgit v1.2.3