From 037107480de9dd11095553ee409cbc748b5c7a68 Mon Sep 17 00:00:00 2001 From: Jacob Thornton Date: Sat, 2 Jun 2012 17:57:36 -0700 Subject: remove isHTML support --- js/tests/unit/bootstrap-tooltip.js | 24 ------------------------ 1 file changed, 24 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 7b0c10de0..51e03486e 100644 --- a/js/tests/unit/bootstrap-tooltip.js +++ b/js/tests/unit/bootstrap-tooltip.js @@ -128,28 +128,4 @@ $(function () { }, 200) }) - test("should detect if title string is html or text: foo", function () { - ok(!$.fn.tooltip.Constructor.prototype.isHTML('foo'), 'correctly detected html') - }) - - test("should detect if title string is html or text: &lt;foo&gt;", function () { - ok(!$.fn.tooltip.Constructor.prototype.isHTML('<foo>'), 'correctly detected html') - }) - - test("should detect if title string is html or text: <div>foo</div>", function () { - ok($.fn.tooltip.Constructor.prototype.isHTML('
foo
'), 'correctly detected html') - }) - - test("should detect if title string is html or text: asdfa<div>foo</div>asdfasdf", function () { - ok($.fn.tooltip.Constructor.prototype.isHTML('asdfa
foo
asdfasdf'), 'correctly detected html') - }) - - test("should detect if title string is html or text: document.createElement('div')", function () { - ok($.fn.tooltip.Constructor.prototype.isHTML(document.createElement('div')), 'correctly detected html') - }) - - test("should detect if title string is html or text: $('<div />)", function () { - ok($.fn.tooltip.Constructor.prototype.isHTML($('
')), 'correctly detected html') - }) - }) -- cgit v1.2.3 From 47e06470866b95cc9c5a2885754a169afd74de39 Mon Sep 17 00:00:00 2001 From: Jon Stevens Date: Mon, 18 Jun 2012 19:51:49 -0700 Subject: add unit tests for destroy behavior of popover and tooltip --- js/tests/unit/bootstrap-tooltip.js | 9 +++++++++ 1 file changed, 9 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 51e03486e..7852305c1 100644 --- a/js/tests/unit/bootstrap-tooltip.js +++ b/js/tests/unit/bootstrap-tooltip.js @@ -128,4 +128,13 @@ $(function () { }, 200) }) + test("should destroy tooltip", function () { + var tooltip = $('
').tooltip() + ok(tooltip.data('tooltip'), 'tooltip has data') + ok(tooltip.data('events').mouseover && tooltip.data('events').mouseout, 'tooltip has hover event') + tooltip.tooltip('destroy') + ok(!tooltip.data('tooltip'), 'tooltip does not have data') + ok(!tooltip.data('events'), 'tooltip does not have any events') + }) + }) -- cgit v1.2.3 From 2ee9b2717bfd532e93eb6d4037ae7ca7a5436957 Mon Sep 17 00:00:00 2001 From: Jon Stevens Date: Mon, 16 Jul 2012 16:01:11 -0700 Subject: namespace the events for popover/tooltip so that they can be cleanly removed. issue #3880 --- js/tests/unit/bootstrap-tooltip.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 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 7852305c1..66bbeac7e 100644 --- a/js/tests/unit/bootstrap-tooltip.js +++ b/js/tests/unit/bootstrap-tooltip.js @@ -129,12 +129,14 @@ $(function () { }) test("should destroy tooltip", function () { - var tooltip = $('
').tooltip() + 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') tooltip.tooltip('destroy') ok(!tooltip.data('tooltip'), 'tooltip does not have data') - ok(!tooltip.data('events'), 'tooltip does not have any events') + 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') }) }) -- cgit v1.2.3 From 117f65d43108d5d7ff1c5011f0b8b61f7ef3b9dd Mon Sep 17 00:00:00 2001 From: Jon Stevens Date: Fri, 20 Jul 2012 09:47:12 -0700 Subject: on destroy, also hide. issue #3880, pull #4104 --- js/tests/unit/bootstrap-tooltip.js | 2 ++ 1 file changed, 2 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 66bbeac7e..2eb8c8f7c 100644 --- a/js/tests/unit/bootstrap-tooltip.js +++ b/js/tests/unit/bootstrap-tooltip.js @@ -133,7 +133,9 @@ $(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') + 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') -- cgit v1.2.3