aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
Diffstat (limited to 'js')
-rw-r--r--js/tests/unit/tooltip.js16
1 files changed, 12 insertions, 4 deletions
diff --git a/js/tests/unit/tooltip.js b/js/tests/unit/tooltip.js
index 81c0fdf73..f4c840d84 100644
--- a/js/tests/unit/tooltip.js
+++ b/js/tests/unit/tooltip.js
@@ -118,9 +118,11 @@ $(function () {
test('should fire shown event', function () {
stop()
- $('<div title="tooltip title"></div>')
+ var tooltip = $('<div title="tooltip title"></div>').appendTo('#qunit-fixture')
+ tooltip
.on('shown.bs.tooltip', function () {
ok(true, 'shown was called')
+ tooltip.remove()
start()
})
.bootstrapTooltip('show')
@@ -142,12 +144,14 @@ $(function () {
test('should fire hide event', function () {
stop()
- $('<div title="tooltip title"></div>')
+ var tooltip = $('<div title="tooltip title"></div>').appendTo('#qunit-fixture')
+ tooltip
.on('shown.bs.tooltip', function () {
$(this).bootstrapTooltip('hide')
})
.on('hide.bs.tooltip', function () {
ok(true, 'hide was called')
+ tooltip.remove()
start()
})
.bootstrapTooltip('show')
@@ -155,12 +159,14 @@ $(function () {
test('should fire hidden event', function () {
stop()
- $('<div title="tooltip title"></div>')
+ var tooltip = $('<div title="tooltip title"></div>').appendTo('#qunit-fixture')
+ tooltip
.on('shown.bs.tooltip', function () {
$(this).bootstrapTooltip('hide')
})
.on('hidden.bs.tooltip', function () {
ok(true, 'hidden was called')
+ tooltip.remove()
start()
})
.bootstrapTooltip('show')
@@ -168,13 +174,15 @@ $(function () {
test('should not fire hidden event when default prevented', function () {
stop()
- $('<div title="tooltip title"></div>')
+ var tooltip = $('<div title="tooltip title"></div>').appendTo('#qunit-fixture')
+ tooltip
.on('shown.bs.tooltip', function () {
$(this).bootstrapTooltip('hide')
})
.on('hide.bs.tooltip', function (e) {
e.preventDefault()
ok(true, 'hide was called')
+ tooltip.remove()
start()
})
.on('hidden.bs.tooltip', function () {