diff --git a/js/tests/unit/scrollspy.js b/js/tests/unit/scrollspy.js
index 084e6fe6ee..b18d91189c 100644
--- a/js/tests/unit/scrollspy.js
+++ b/js/tests/unit/scrollspy.js
@@ -124,17 +124,17 @@ $(function () {
test('should add the active class to the correct element', function () {
var navbarHtml =
- '
'
+ ''
var contentHtml =
- '' +
- '
div 1
' +
- '
div 2
' +
- '
'
+ ''
+ + '
div 1
'
+ + '
div 2
'
+ + '
'
$(navbarHtml).appendTo('#qunit-fixture')
var $content = $(contentHtml)
@@ -143,7 +143,7 @@ $(function () {
var testElementIsActiveAfterScroll = function (element, target) {
var deferred = $.Deferred()
- var scrollHeight = $content.scrollTop() + $(target).position().top
+ var scrollHeight = Math.ceil($content.scrollTop() + $(target).position().top)
stop()
$content.one('scroll', function () {
ok($(element).hasClass('active'), 'target:' + target + ', element' + element)