Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/js/tests
diff options
context:
space:
mode:
authorJohann-S <johann.servoire@gmail.com>2018-08-11 23:40:47 +0300
committerJohann-S <johann.servoire@gmail.com>2018-08-12 18:01:01 +0300
commiteab9da5beb5a2fdba8be4e54dfcdac0de4eba2f6 (patch)
tree3902027fb0c53a081cbbb52072aee0a4b51a4f00 /js/tests
parent6b92321f6a04f07e0a3531d0e546c3cc20867bdb (diff)
fix(util): use querySelector for ids
Diffstat (limited to 'js/tests')
-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 49252701a5..4f44c29073 100644
--- a/js/tests/unit/util.js
+++ b/js/tests/unit/util.js
@@ -32,6 +32,19 @@ $(function () {
assert.ok(spy.called)
})
+ QUnit.test('Util.getSelectorFromElement should use querySelector when there are multi ids', function (assert) {
+ assert.expect(2)
+
+ var spy = sinon.spy(document, 'querySelector')
+
+ var $el = $('<div data-target="#j7, #j8"></div>').appendTo($('#qunit-fixture'))
+ $('<div id="j7" />').appendTo($('#qunit-fixture'))
+ $('<div id="j8" />').appendTo($('#qunit-fixture'))
+
+ assert.strictEqual(Util.getSelectorFromElement($el[0]), '#j7, #j8')
+ assert.ok(spy.called)
+ })
+
QUnit.test('Util.typeCheckConfig should thrown an error when a bad config is passed', function (assert) {
assert.expect(1)
var namePlugin = 'collapse'