Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohann-S <johann.servoire@gmail.com>2015-09-16 11:35:29 +0300
committerJohann-S <johann.servoire@gmail.com>2015-10-02 11:01:24 +0300
commit21a65f181eebc3f2c0cd43fb3383ee3de673745b (patch)
tree72a1c5e6da10a3dd7c918e05d0eff6a4d8e0c0aa /js/tests/unit/tooltip.js
parentc34fdd415e864e5e6a64f36a0278b5d43c15d3a2 (diff)
Add throw error for undefined method on plugins
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 934e26b9e0..9ec5ddb037 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/>')