aboutsummaryrefslogtreecommitdiff
path: root/js/tests/unit/tooltip.js
diff options
context:
space:
mode:
authorChris Rebert <[email protected]>2015-10-02 01:18:16 -0700
committerChris Rebert <[email protected]>2015-10-02 01:18:16 -0700
commit10f6e97ec2c59cbeb3c892936e8b7cb3faa1e247 (patch)
treedeb94d828c341c1cfe61cf0435bb2f2d21836a21 /js/tests/unit/tooltip.js
parenta89bfc65252f648469e84242289b8a45a49d08e9 (diff)
parent21a65f181eebc3f2c0cd43fb3383ee3de673745b (diff)
downloadbootstrap-10f6e97ec2c59cbeb3c892936e8b7cb3faa1e247.tar.xz
bootstrap-10f6e97ec2c59cbeb3c892936e8b7cb3faa1e247.zip
Merge pull request #17616 from Johann-S/ThrowError
Fix #17612: Throw explicit error when a nonexistent method is invoked
Diffstat (limited to 'js/tests/unit/tooltip.js')
-rw-r--r--js/tests/unit/tooltip.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/js/tests/unit/tooltip.js b/js/tests/unit/tooltip.js
index 934e26b9e..9ec5ddb03 100644
--- a/js/tests/unit/tooltip.js
+++ b/js/tests/unit/tooltip.js
@@ -25,6 +25,18 @@ $(function () {
assert.strictEqual($.fn.tooltip, undefined, 'tooltip was set back to undefined (org value)')
})
+ QUnit.test('should throw explicit error on undefined method', function (assert) {
+ assert.expect(1)
+ var $el = $('<div/>')
+ $el.bootstrapTooltip()
+ try {
+ $el.bootstrapTooltip('noMethod')
+ }
+ catch (err) {
+ assert.strictEqual(err.message, 'No method named "noMethod"')
+ }
+ })
+
QUnit.test('should return jquery collection containing the element', function (assert) {
assert.expect(2)
var $el = $('<div/>')