diff options
author | Shohei Yoshida <ysds.code@gmail.com> | 2020-06-25 11:35:53 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-25 11:35:53 +0300 |
commit | fb4efb49ea7f5ebe36e67a457b8f713b2c5b2bb4 (patch) | |
tree | bba998e1ba3249352518f535ad979eef116871c7 /js/tests/unit/modal.spec.js | |
parent | 9f173aeff363b6b535e5d0956f210107456c2904 (diff) |
Prevent overflowing static backdrop modal animation (#30326)
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
Diffstat (limited to 'js/tests/unit/modal.spec.js')
-rw-r--r-- | js/tests/unit/modal.spec.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/js/tests/unit/modal.spec.js b/js/tests/unit/modal.spec.js index afb8f2c2d4..253f935135 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>' |