mirror of
https://github.com/tenrok/bootstrap.git
synced 2026-06-05 16:42:29 +03:00
throw error when folks try to use a bad selector
This commit is contained in:
@@ -20,6 +20,19 @@ $(function () {
|
||||
assert.strictEqual(Util.getSelectorFromElement($el2[0]), null)
|
||||
})
|
||||
|
||||
QUnit.test('Util.getSelectorFromElement should throw error when there is a bad selector', function (assert) {
|
||||
assert.expect(2)
|
||||
|
||||
var $el = $('<div data-target="#1"></div>').appendTo($('#qunit-fixture'))
|
||||
|
||||
try {
|
||||
assert.ok(true, 'trying to use a bad selector')
|
||||
Util.getSelectorFromElement($el[0])
|
||||
} catch (e) {
|
||||
assert.ok(e instanceof DOMException)
|
||||
}
|
||||
})
|
||||
|
||||
QUnit.test('Util.typeCheckConfig should thrown an error when a bad config is passed', function (assert) {
|
||||
assert.expect(1)
|
||||
var namePlugin = 'collapse'
|
||||
|
||||
Reference in New Issue
Block a user