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:
@@ -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/>')
|
||||
|
Reference in New Issue
Block a user