diff options
Diffstat (limited to 'js/tests/unit/tooltip.js')
-rw-r--r-- | js/tests/unit/tooltip.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/js/tests/unit/tooltip.js b/js/tests/unit/tooltip.js index de313ff953..97c5855cb0 100644 --- a/js/tests/unit/tooltip.js +++ b/js/tests/unit/tooltip.js @@ -185,6 +185,19 @@ $(function () { .bootstrapTooltip('show') }) + QUnit.test('should throw an error when show is called on hidden elements', function (assert) { + assert.expect(1) + var done = assert.async() + + try { + $('<div title="tooltip title" style="display: none"/>').bootstrapTooltip('show') + } + catch (err) { + assert.strictEqual(err.message, 'Please use show on visible elements') + done() + } + }) + QUnit.test('should fire inserted event', function (assert) { assert.expect(2) var done = assert.async() |