1
0
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:
Johann-S
2018-09-14 14:27:30 +02:00
committed by XhmikosR
parent 19b836c907
commit a2f1d79045
12 changed files with 458 additions and 448 deletions

View File

@@ -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)
})
})