From a7f1b59959b12ab2e78c32e6954d083601ad45ba Mon Sep 17 00:00:00 2001 From: Johann Date: Tue, 1 Nov 2016 04:33:53 +0100 Subject: Making .tooltip('show') throw an error on elements with display:none (#20940) --- js/tests/unit/tooltip.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'js/tests/unit/tooltip.js') 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 { + $('
').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() -- cgit v1.2.3