diff options
Diffstat (limited to 'js')
-rw-r--r-- | js/tests/unit/bootstrap-popover.js | 10 | ||||
-rw-r--r-- | js/tests/unit/bootstrap-tooltip.js | 9 |
2 files changed, 19 insertions, 0 deletions
diff --git a/js/tests/unit/bootstrap-popover.js b/js/tests/unit/bootstrap-popover.js index afd6b170b4..6d5d9f7a18 100644 --- a/js/tests/unit/bootstrap-popover.js +++ b/js/tests/unit/bootstrap-popover.js @@ -90,4 +90,14 @@ $(function () { ok(!$('.popover').length, 'popover was removed') $('#qunit-fixture').empty() }) + + test("should destroy popover", function () { + var popover = $('<div/>').popover() + ok(popover.data('popover'), 'popover has data') + ok(popover.data('events').mouseover && popover.data('events').mouseout, 'popover has hover event') + popover.popover('destroy') + ok(!popover.data('popover'), 'popover does not have data') + ok(!popover.data('events'), 'popover does not have any events') + }) + })
\ No newline at end of file diff --git a/js/tests/unit/bootstrap-tooltip.js b/js/tests/unit/bootstrap-tooltip.js index 51e03486e6..7852305c1e 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 = $('<div/>').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') + }) + }) |