From fb4efb49ea7f5ebe36e67a457b8f713b2c5b2bb4 Mon Sep 17 00:00:00 2001 From: Shohei Yoshida Date: Thu, 25 Jun 2020 17:35:53 +0900 Subject: Prevent overflowing static backdrop modal animation (#30326) Co-authored-by: XhmikosR --- js/tests/unit/modal.spec.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'js/tests') 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 = '' + + 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 = '' -- cgit v1.2.3