mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-12 08:34:08 +02:00
Refactor util plugin and some tests
This commit is contained in:
@@ -119,11 +119,6 @@ $(function () {
|
||||
assert.ok(id !== id2, id + ' !== ' + id2)
|
||||
})
|
||||
|
||||
QUnit.test('Util.supportsTransitionEnd should return true', function (assert) {
|
||||
assert.expect(1)
|
||||
assert.ok(Util.supportsTransitionEnd())
|
||||
})
|
||||
|
||||
QUnit.test('Util.findShadowRoot should find the shadow DOM root', function (assert) {
|
||||
// Only for newer browsers
|
||||
if (!document.documentElement.attachShadow) {
|
||||
@@ -178,4 +173,21 @@ $(function () {
|
||||
|
||||
window.$ = jQuery
|
||||
})
|
||||
|
||||
QUnit.test('Util.emulateTransitionEnd should emulate transition end', function (assert) {
|
||||
assert.expect(1)
|
||||
var $div = $('<div></div>').appendTo($('#qunit-fixture'))
|
||||
|
||||
var spy = sinon.spy($div[0], 'removeEventListener')
|
||||
|
||||
Util.emulateTransitionEnd($div[0], 7)
|
||||
|
||||
assert.ok(spy.notCalled)
|
||||
})
|
||||
|
||||
QUnit.test('Util.makeArray should return empty array on null', function (assert) {
|
||||
assert.expect(1)
|
||||
|
||||
assert.ok(Util.makeArray(null).length === 0)
|
||||
})
|
||||
})
|
||||
|
Reference in New Issue
Block a user