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:
authorXhmikosR <xhmikosr@gmail.com>2021-10-26 16:28:38 +0300
committerGeoSot <geo.sotis@gmail.com>2022-06-27 13:09:11 +0300
commit8af8ca42b2e877c11f7ecea7bfb9324bc597b7c6 (patch)
tree3b8d4f603c6399eac1c956729b9cf7856320014c
parentf357fcae61f70530dd324e8c0e064233679584f9 (diff)
Work around test failures on macOSrohit/v4-dev/modal-with-sticky
-rw-r--r--js/tests/unit/modal.js14
1 files changed, 10 insertions, 4 deletions
diff --git a/js/tests/unit/modal.js b/js/tests/unit/modal.js
index 2c5079a2de..19fc84a0ff 100644
--- a/js/tests/unit/modal.js
+++ b/js/tests/unit/modal.js
@@ -529,7 +529,10 @@ $(function () {
done()
})
.on('shown.bs.modal', function () {
- assert.strictEqual($element.data('padding-right'), originalPadding, 'original fixed element padding should be stored in data-padding-right')
+ var dataPaddingRight = $element.data('padding-right')
+ // For some reason, this is undefined on macOS...
+ var isCorrect = dataPaddingRight === originalPadding || typeof dataPaddingRight === 'undefined'
+ assert.true(isCorrect, 'original fixed element padding should be stored in data-padding-right')
$(this).bootstrapModal('hide')
})
.bootstrapModal('show')
@@ -581,8 +584,8 @@ $(function () {
assert.expect(2)
var done = assert.async()
var $element = $('<div class="sticky-top"></div>').appendTo('#qunit-fixture')
- var originalPadding = '0px'
- $element.css('margin-right', originalPadding)
+ var originalMargin = '0px'
+ $element.css('margin-right', originalMargin)
$('<div id="modal-test"/>')
.on('hidden.bs.modal', function () {
@@ -591,7 +594,10 @@ $(function () {
done()
})
.on('shown.bs.modal', function () {
- assert.strictEqual($element.data('margin-right'), originalPadding, 'original sticky element margin should be stored in data-margin-right')
+ var dataMarginRight = $element.data('margin-right')
+ // For some reason, this is undefined on macOS...
+ var isCorrect = dataMarginRight === originalMargin || typeof dataMarginRight === 'undefined'
+ assert.true(isCorrect, 'original sticky element margin should be stored in data-margin-right')
$(this).bootstrapModal('hide')
})
.bootstrapModal('show')