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
path: root/js
diff options
context:
space:
mode:
authorDave Methvin <dave.methvin@gmail.com>2016-06-28 04:41:00 +0300
committerChris Rebert <code@chrisrebert.com>2016-07-08 09:32:18 +0300
commit4a8b29fbf5ad912228a13c7b45470b4909472e43 (patch)
tree619d668b5028172fde31291f55261106cdc653d4 /js
parentdaad359f016949725f4ba39645e3f9ade7dda246 (diff)
Port #20190 to v3
Scrollspy test: Allow for async .then() in jQuery 3; fixes #20182 Instead of doing a new assert.async(), just do a single one for the entire test and let the .then() be async as well.
Diffstat (limited to 'js')
-rw-r--r--js/tests/unit/scrollspy.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/js/tests/unit/scrollspy.js b/js/tests/unit/scrollspy.js
index bf5fa0bff5..d50573f27a 100644
--- a/js/tests/unit/scrollspy.js
+++ b/js/tests/unit/scrollspy.js
@@ -258,21 +258,21 @@ $(function () {
var testElementIsActiveAfterScroll = function (element, target) {
var deferred = $.Deferred()
var scrollHeight = Math.ceil($content.scrollTop() + $(target).position().top)
- var done = assert.async()
$content.one('scroll', function () {
assert.ok($(element).hasClass('active'), 'target:' + target + ', element: ' + element)
- done()
deferred.resolve()
})
$content.scrollTop(scrollHeight)
return deferred.promise()
}
+ var done = assert.async()
$.when(testElementIsActiveAfterScroll('#li-100-5', '#div-100-5'))
.then(function () { return testElementIsActiveAfterScroll('#li-100-4', '#div-100-4') })
.then(function () { return testElementIsActiveAfterScroll('#li-100-3', '#div-100-3') })
.then(function () { return testElementIsActiveAfterScroll('#li-100-2', '#div-100-2') })
.then(function () { return testElementIsActiveAfterScroll('#li-100-1', '#div-100-1') })
+ .then(function () { done() })
})
})