aboutsummaryrefslogtreecommitdiff
path: root/js/tests/unit/util.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/tests/unit/util.js')
-rw-r--r--js/tests/unit/util.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/js/tests/unit/util.js b/js/tests/unit/util.js
index 37327b868..768afc8fe 100644
--- a/js/tests/unit/util.js
+++ b/js/tests/unit/util.js
@@ -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'