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
diff options
context:
space:
mode:
authorJohann-S <johann.servoire@gmail.com>2019-02-06 16:35:59 +0300
committerJohann-S <johann.servoire@gmail.com>2019-02-06 17:01:13 +0300
commitb54ddfda83bf1d8a01bc97e7636bdc4ae4af888a (patch)
tree8cdb7e8db39d76b49b795a361b885dd0ac1250a9
parent3c49467224cc7f37ce56ce9c287de8f169efd7b3 (diff)
fix modal test to be sure we call getTransitionDurationFromElement
-rw-r--r--js/tests/unit/modal.js15
1 files changed, 5 insertions, 10 deletions
diff --git a/js/tests/unit/modal.js b/js/tests/unit/modal.js
index 1762904803..9b7fb0aa66 100644
--- a/js/tests/unit/modal.js
+++ b/js/tests/unit/modal.js
@@ -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) {