aboutsummaryrefslogtreecommitdiff
path: root/js/tests/unit
diff options
context:
space:
mode:
authorDavid Bailey <[email protected]>2017-08-28 16:21:04 +0100
committerDavid Bailey <[email protected]>2017-08-28 16:21:04 +0100
commit487513ff03b3d63ad3b3fe641dae2a3882d5ded5 (patch)
tree9e1cac733db318bfd288486b546fefa5eb61494b /js/tests/unit
parent78f29d2b3cb9bd888c927e8d50ee6962c2f9d407 (diff)
downloadbootstrap-487513ff03b3d63ad3b3fe641dae2a3882d5ded5.tar.xz
bootstrap-487513ff03b3d63ad3b3fe641dae2a3882d5ded5.zip
Add failing test
When the body does not overflow (achieved by hiding the QUnit container), it should not be given a margin.
Diffstat (limited to 'js/tests/unit')
-rw-r--r--js/tests/unit/modal.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/js/tests/unit/modal.js b/js/tests/unit/modal.js
index 5b265df15..3611dfdf1 100644
--- a/js/tests/unit/modal.js
+++ b/js/tests/unit/modal.js
@@ -391,6 +391,25 @@ $(function () {
.bootstrapModal('show')
})
+ QUnit.test('should not adjust the inline body padding when it does not overflow', function (assert) {
+ assert.expect(1)
+ var done = assert.async()
+ var $body = $(document.body)
+ var originalPadding = $body.css('padding-right')
+
+ $('#qunit-container').hide()
+ $('<div id="modal-test"/>')
+ .on('shown.bs.modal', function () {
+ var currentPadding = $body.css('padding-right')
+ assert.strictEqual(currentPadding, originalPadding, 'body padding should not be adjusted')
+ $(this).bootstrapModal('hide')
+
+ $('#qunit-container').show()
+ done()
+ })
+ .bootstrapModal('show')
+ })
+
QUnit.test('should adjust the inline padding of fixed elements when opening and restore when closing', function (assert) {
assert.expect(2)
var done = assert.async()