mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-14 09:34:36 +02:00
add information about valid selectors (#27137)
This commit is contained in:
@@ -20,31 +20,6 @@ $(function () {
|
||||
assert.strictEqual(Util.getSelectorFromElement($el2[0]), null)
|
||||
})
|
||||
|
||||
QUnit.test('Util.getSelectorFromElement should use getElementById', function (assert) {
|
||||
assert.expect(2)
|
||||
|
||||
var spy = sinon.spy(document, 'getElementById')
|
||||
|
||||
var $el = $('<div data-target="#7"></div>').appendTo($('#qunit-fixture'))
|
||||
$('<div id="7" />').appendTo($('#qunit-fixture'))
|
||||
|
||||
assert.strictEqual(Util.getSelectorFromElement($el[0]), '#7')
|
||||
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'
|
||||
|
Reference in New Issue
Block a user