mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-11 08:04:59 +02:00
Add failing test
When the body does not overflow (achieved by hiding the QUnit container), it should not be given a margin.
This commit is contained in:
@@ -391,6 +391,25 @@ $(function () {
|
|||||||
.bootstrapModal('show')
|
.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) {
|
QUnit.test('should adjust the inline padding of fixed elements when opening and restore when closing', function (assert) {
|
||||||
assert.expect(2)
|
assert.expect(2)
|
||||||
var done = assert.async()
|
var done = assert.async()
|
||||||
|
Reference in New Issue
Block a user