diff options
| author | Chris Rebert <[email protected]> | 2014-06-06 15:30:44 -0700 |
|---|---|---|
| committer | Chris Rebert <[email protected]> | 2014-06-07 17:54:11 -0700 |
| commit | b23ed1b034caa90a4f6d0f97674022c80126d078 (patch) | |
| tree | 158688d212d311aef64c775d1b99ddb8c535be47 | |
| parent | 20c099d41a0802a7f377e7f996c35cade9e0c431 (diff) | |
| download | bootstrap-b23ed1b034caa90a4f6d0f97674022c80126d078.tar.xz bootstrap-b23ed1b034caa90a4f6d0f97674022c80126d078.zip | |
put the tooltips into the DOM in the tooltip unit tests
| -rw-r--r-- | js/tests/unit/tooltip.js | 16 |
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 () { |
