mirror of
https://github.com/twbs/bootstrap.git
synced 2024-12-01 13:24:25 +01:00
fix unit tests for chrome mobile
This commit is contained in:
parent
80dfee9dc1
commit
14f53d9baa
@ -800,7 +800,7 @@ $(function () {
|
||||
|
||||
var $modalBody = $('.modal-body')
|
||||
$modalBody.scrollTop(100)
|
||||
assert.strictEqual($modalBody.scrollTop(), 100)
|
||||
assert.ok($modalBody.scrollTop() > 95 && $modalBody.scrollTop() <= 100)
|
||||
|
||||
$modal.on('shown.bs.modal', function () {
|
||||
assert.strictEqual($modalBody.scrollTop(), 0, 'modal body scrollTop should be 0 when opened')
|
||||
|
@ -203,7 +203,9 @@ $(function () {
|
||||
var done = assert.async()
|
||||
var testElementIsActiveAfterScroll = function (element, target) {
|
||||
var deferred = $.Deferred()
|
||||
var scrollHeight = Math.ceil($content.scrollTop() + $(target).position().top)
|
||||
// add top padding to fix Chrome on Android failures
|
||||
var paddingTop = 5
|
||||
var scrollHeight = Math.ceil($content.scrollTop() + $(target).position().top) + paddingTop
|
||||
$content.one('scroll', function () {
|
||||
assert.ok($(element).hasClass('active'), 'target:' + target + ', element' + element)
|
||||
deferred.resolve()
|
||||
@ -247,7 +249,9 @@ $(function () {
|
||||
var done = assert.async()
|
||||
var testElementIsActiveAfterScroll = function (element, target) {
|
||||
var deferred = $.Deferred()
|
||||
var scrollHeight = Math.ceil($content.scrollTop() + $(target).position().top)
|
||||
// add top padding to fix Chrome on Android failures
|
||||
var paddingTop = 5
|
||||
var scrollHeight = Math.ceil($content.scrollTop() + $(target).position().top) + paddingTop
|
||||
$content.one('scroll', function () {
|
||||
assert.ok($(element).hasClass('active'), 'target:' + target + ', element' + element)
|
||||
deferred.resolve()
|
||||
@ -291,7 +295,9 @@ $(function () {
|
||||
var done = assert.async()
|
||||
var testElementIsActiveAfterScroll = function (element, target) {
|
||||
var deferred = $.Deferred()
|
||||
var scrollHeight = Math.ceil($content.scrollTop() + $(target).position().top)
|
||||
// add top padding to fix Chrome on Android failures
|
||||
var paddingTop = 5
|
||||
var scrollHeight = Math.ceil($content.scrollTop() + $(target).position().top) + paddingTop
|
||||
$content.one('scroll', function () {
|
||||
assert.ok($(element).hasClass('active'), 'target:' + target + ', element' + element)
|
||||
deferred.resolve()
|
||||
@ -606,7 +612,9 @@ $(function () {
|
||||
|
||||
var testElementIsActiveAfterScroll = function (element, target) {
|
||||
var deferred = $.Deferred()
|
||||
var scrollHeight = Math.ceil($content.scrollTop() + $(target).position().top)
|
||||
// add top padding to fix Chrome on Android failures
|
||||
var paddingTop = 5
|
||||
var scrollHeight = Math.ceil($content.scrollTop() + $(target).position().top) + paddingTop
|
||||
$content.one('scroll', function () {
|
||||
assert.ok($(element).hasClass('active'), 'target:' + target + ', element: ' + element)
|
||||
deferred.resolve()
|
||||
|
Loading…
Reference in New Issue
Block a user