Commit 47e06470 authored by Jon Stevens's avatar Jon Stevens
Browse files

add unit tests for destroy behavior of popover and tooltip

parent 6a974f9f
9 merge requests!4427Use variable for desktop media query,!4258Aria,!4248Amended mentions of 'javascript' to the correct 'JavaScript',!4235Patch 1,!4232Fixing the modal z-index issue + make modal stacking possible,!42132.1.0 wip,!4165Patch 2,!39192.1.0 wip,!3880Add popover / tooltip destroy method
Showing with 19 additions and 0 deletions
+19 -0
...@@ -90,4 +90,14 @@ $(function () { ...@@ -90,4 +90,14 @@ $(function () {
ok(!$('.popover').length, 'popover was removed') ok(!$('.popover').length, 'popover was removed')
$('#qunit-fixture').empty() $('#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
...@@ -128,4 +128,13 @@ $(function () { ...@@ -128,4 +128,13 @@ $(function () {
}, 200) }, 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')
})
}) })
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment