1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-10-01 07:46:47 +02:00

Add throw error for undefined method on plugins

This commit is contained in:
Johann-S
2015-09-16 10:35:29 +02:00
parent c34fdd415e
commit 21a65f181e
16 changed files with 121 additions and 4 deletions

View File

@@ -24,6 +24,18 @@ $(function () {
assert.strictEqual($.fn.dropdown, undefined, 'dropdown 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.bootstrapDropdown()
try {
$el.bootstrapDropdown('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/>')