aboutsummaryrefslogtreecommitdiff
path: root/js/tests/unit/popover.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/tests/unit/popover.js')
-rw-r--r--js/tests/unit/popover.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/js/tests/unit/popover.js b/js/tests/unit/popover.js
index ce89c8dbd..73a67c984 100644
--- a/js/tests/unit/popover.js
+++ b/js/tests/unit/popover.js
@@ -247,4 +247,16 @@ $(function () {
}, new Error('`selector` option must be specified when initializing popover on the window.document object!'))
})
+ QUnit.test('should do nothing when an attempt is made to hide an uninitialized popover', function (assert) {
+ assert.expect(1)
+
+ var $popover = $('<span data-toggle="popover" data-title="some title" data-content="some content">some text</span>')
+ .appendTo('#qunit-fixture')
+ .on('hidden.bs.popover shown.bs.popover', function () {
+ assert.ok(false, 'should not fire any popover events')
+ })
+ .bootstrapPopover('hide')
+ assert.strictEqual($popover.data('bs.popover'), undefined, 'should not initialize the popover')
+ })
+
})