aboutsummaryrefslogtreecommitdiff
path: root/js/tests/unit/bootstrap-tooltip.js
diff options
context:
space:
mode:
authorJacob Thornton <[email protected]>2012-08-20 16:13:46 -0700
committerJacob Thornton <[email protected]>2012-08-20 16:13:46 -0700
commit5d63e8e2a84468351b4c1ee6cc21f48e95ea27bf (patch)
tree2d760c794e61c15850d14d5eee1c565ab4f9a871 /js/tests/unit/bootstrap-tooltip.js
parent5df1e2c00a295c45db7fa75dba333dc9464b128c (diff)
parentaa2cec6f2f706f8c1754f8bf79a8c9f094445bd8 (diff)
downloadbootstrap-5d63e8e2a84468351b4c1ee6cc21f48e95ea27bf.tar.xz
bootstrap-5d63e8e2a84468351b4c1ee6cc21f48e95ea27bf.zip
fMerge branch '2.1.0-wip'
Conflicts: docs/index.html
Diffstat (limited to 'js/tests/unit/bootstrap-tooltip.js')
-rw-r--r--js/tests/unit/bootstrap-tooltip.js33
1 files changed, 11 insertions, 22 deletions
diff --git a/js/tests/unit/bootstrap-tooltip.js b/js/tests/unit/bootstrap-tooltip.js
index 7b0c10de0..2eb8c8f7c 100644
--- a/js/tests/unit/bootstrap-tooltip.js
+++ b/js/tests/unit/bootstrap-tooltip.js
@@ -128,28 +128,17 @@ $(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: &amp;lt;foo&amp;gt;", function () {
- ok(!$.fn.tooltip.Constructor.prototype.isHTML('&lt;foo&gt;'), 'correctly detected html')
- })
-
- test("should detect if title string is html or text: &lt;div>foo&lt;/div>", function () {
- ok($.fn.tooltip.Constructor.prototype.isHTML('<div>foo</div>'), 'correctly detected html')
- })
-
- test("should detect if title string is html or text: asdfa&lt;div>foo&lt;/div>asdfasdf", function () {
- ok($.fn.tooltip.Constructor.prototype.isHTML('asdfa<div>foo</div>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: $('&lt;div />)", function () {
- ok($.fn.tooltip.Constructor.prototype.isHTML($('<div></div>')), 'correctly detected html')
+ test("should destroy tooltip", function () {
+ var tooltip = $('<div/>').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('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')
})
})