1
0
Fork 0
mirror of https://github.com/twbs/bootstrap.git synced 2022-11-09 12:25:43 -05:00

fix modal test to be sure we call getTransitionDurationFromElement

This commit is contained in:
Johann-S 2019-02-06 14:35:59 +01:00
parent 3c49467224
commit b54ddfda83

View file

@ -669,7 +669,7 @@ $(function () {
})
QUnit.test('transition duration should be the modal-dialog duration before triggering shown event', function (assert) {
assert.expect(2)
assert.expect(1)
var done = assert.async()
var style = [
'<style>',
@ -694,22 +694,17 @@ $(function () {
'</div>'
].join('')
var beginTimestamp = 0
var $modal = $(modalHTML).appendTo('#qunit-fixture')
var $modalDialog = $('.modal-dialog')
var transitionDuration = Util.getTransitionDurationFromElement($modalDialog[0])
assert.strictEqual(transitionDuration, 300)
var expectedTransitionDuration = 300
var spy = sinon.spy(Util, 'getTransitionDurationFromElement')
$modal.on('shown.bs.modal', function () {
var diff = Date.now() - beginTimestamp
assert.ok(diff < 400)
assert.ok(spy.returned(expectedTransitionDuration))
$style.remove()
spy.restore()
done()
})
.bootstrapModal('show')
beginTimestamp = Date.now()
})
QUnit.test('should dispose modal', function (assert) {