mirror of
https://github.com/tenrok/bootstrap.git
synced 2026-06-08 17:22:31 +03:00
Add throw error for undefined method on plugins
This commit is contained in:
@@ -24,6 +24,18 @@ $(function () {
|
||||
assert.strictEqual($.fn.modal, undefined, 'modal was set back to undefined (orig value)')
|
||||
})
|
||||
|
||||
QUnit.test('should throw explicit error on undefined method', function (assert) {
|
||||
assert.expect(1)
|
||||
var $el = $('<div id="modal-test"/>')
|
||||
$el.bootstrapModal()
|
||||
try {
|
||||
$el.bootstrapModal('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 id="modal-test"/>')
|
||||
|
||||
Reference in New Issue
Block a user