diff options
| author | fat <[email protected]> | 2013-07-17 23:30:05 -0700 |
|---|---|---|
| committer | fat <[email protected]> | 2013-07-17 23:30:05 -0700 |
| commit | 59f847e8eef64c4adbc57a682ad626e068370b30 (patch) | |
| tree | 0e58851b0ea3e0648f1cc4f0960406f8e38c3499 | |
| parent | 8cf04911db36b1ad5f4a98db51b44050c78df18a (diff) | |
| download | bootstrap-59f847e8eef64c4adbc57a682ad626e068370b30.tar.xz bootstrap-59f847e8eef64c4adbc57a682ad626e068370b30.zip | |
fixes #7777
| -rw-r--r-- | js/tests/unit/tooltip.js | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/js/tests/unit/tooltip.js b/js/tests/unit/tooltip.js index 610505588..5f7847e92 100644 --- a/js/tests/unit/tooltip.js +++ b/js/tests/unit/tooltip.js @@ -305,4 +305,40 @@ $(function () { ok( Math.round(target.offset().top + target[0].offsetHeight/2 - tooltip[0].offsetHeight/2) === Math.round(tooltip.offset().top) ) target.tooltip('hide') }) + + test("tooltip title test #1", function () { + var tooltip = $('<a href="#" rel="tooltip" title="Simple tooltip" style="display: inline-block; position: absolute; top: 0; left: 0;"></a>') + .appendTo('#qunit-fixture') + .tooltip({ + }) + .tooltip('show') + equal($('.tooltip').children('.tooltip-inner').text(), 'Simple tooltip', 'title from title attribute is set') + tooltip.tooltip('hide') + ok(!$(".tooltip").length, 'tooltip removed') + }) + + test("tooltip title test #2", function () { + var tooltip = $('<a href="#" rel="tooltip" title="Simple tooltip" style="display: inline-block; position: absolute; top: 0; left: 0;"></a>') + .appendTo('#qunit-fixture') + .tooltip({ + title: 'This is a tooltip with some content' + }) + .tooltip('show') + equal($('.tooltip').children('.tooltip-inner').text(), 'Simple tooltip', 'title is set from title attribute while prefered over title option') + tooltip.tooltip('hide') + ok(!$(".tooltip").length, 'tooltip removed') + }) + + test("tooltip title test #3", function () { + var tooltip = $('<a href="#" rel="tooltip" style="display: inline-block; position: absolute; top: 0; left: 0;"></a>') + .appendTo('#qunit-fixture') + .tooltip({ + title: 'This is a tooltip with some content' + }) + .tooltip('show') + equal($('.tooltip').children('.tooltip-inner').text(), 'This is a tooltip with some content', 'title from title option is set') + tooltip.tooltip('hide') + ok(!$(".tooltip").length, 'tooltip removed') + }) + }) |
