aboutsummaryrefslogtreecommitdiff
path: root/js/tests
diff options
context:
space:
mode:
authorShohei Yoshida <[email protected]>2020-06-25 17:35:53 +0900
committerGitHub <[email protected]>2020-06-25 11:35:53 +0300
commitfb4efb49ea7f5ebe36e67a457b8f713b2c5b2bb4 (patch)
treebba998e1ba3249352518f535ad979eef116871c7 /js/tests
parent9f173aeff363b6b535e5d0956f210107456c2904 (diff)
downloadbootstrap-fb4efb49ea7f5ebe36e67a457b8f713b2c5b2bb4.tar.xz
bootstrap-fb4efb49ea7f5ebe36e67a457b8f713b2c5b2bb4.zip
Prevent overflowing static backdrop modal animation (#30326)
Co-authored-by: XhmikosR <[email protected]>
Diffstat (limited to 'js/tests')
-rw-r--r--js/tests/unit/modal.spec.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/js/tests/unit/modal.spec.js b/js/tests/unit/modal.spec.js
index afb8f2c2d..253f93513 100644
--- a/js/tests/unit/modal.spec.js
+++ b/js/tests/unit/modal.spec.js
@@ -626,6 +626,25 @@ describe('Modal', () => {
modal.show()
})
+ it('should not overflow when clicking outside of modal-content if backdrop = static', done => {
+ fixtureEl.innerHTML = '<div class="modal" data-backdrop="static"><div class="modal-dialog" style="transition-duration: 20ms;"></div></div>'
+
+ const modalEl = fixtureEl.querySelector('.modal')
+ const modal = new Modal(modalEl, {
+ backdrop: 'static'
+ })
+
+ modalEl.addEventListener('shown.bs.modal', () => {
+ modalEl.click()
+ setTimeout(() => {
+ expect(modalEl.clientHeight === modalEl.scrollHeight).toEqual(true)
+ done()
+ }, 20)
+ })
+
+ modal.show()
+ })
+
it('should not adjust the inline body padding when it does not overflow', done => {
fixtureEl.innerHTML = '<div class="modal"><div class="modal-dialog"></div></div>'