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
path: root/js/tests
diff options
context:
space:
mode:
authorJohann-S <johann.servoire@gmail.com>2019-07-28 13:19:00 +0300
committerXhmikosR <xhmikosr@gmail.com>2019-07-31 11:37:39 +0300
commite4d4c5d0bc9f5560e730ec3df06a538400e6ff6d (patch)
tree59aadaee27bf1c197f8cac00f410a092d3c25e2b /js/tests
parent8f95b26d65717a208db0ff60e3c5fa43db4ef6d3 (diff)
Backport #29155
allow dynamic modal body for scrollable modals
Diffstat (limited to 'js/tests')
-rw-r--r--js/tests/unit/modal.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/js/tests/unit/modal.js b/js/tests/unit/modal.js
index f14ef3290a..d22d8a1de7 100644
--- a/js/tests/unit/modal.js
+++ b/js/tests/unit/modal.js
@@ -812,4 +812,25 @@ $(function () {
})
.bootstrapModal('show')
})
+
+ QUnit.test('should set .modal\'s scroll top to 0 if .modal-dialog-scrollable and modal body do not exists', function (assert) {
+ assert.expect(1)
+ var done = assert.async()
+
+ var $modal = $([
+ '<div id="modal-test">',
+ ' <div class="modal-dialog modal-dialog-scrollable">',
+ ' <div class="modal-content">',
+ ' </div>',
+ ' </div>',
+ '</div>'
+ ].join('')).appendTo('#qunit-fixture')
+
+
+ $modal.on('shown.bs.modal', function () {
+ assert.strictEqual($modal.scrollTop(), 0)
+ done()
+ })
+ .bootstrapModal('show')
+ })
})