diff options
author | ysds <ysds.code@gmail.com> | 2020-03-04 17:51:15 +0300 |
---|---|---|
committer | XhmikosR <xhmikosr@gmail.com> | 2020-04-01 10:05:43 +0300 |
commit | dfa017adc382c63766cd5d021bdc8f6ad1b04932 (patch) | |
tree | 27cd38310b20f60bf3b80428041c8e04fd04666a /js/tests/unit/modal.spec.js | |
parent | 05fb3905e696484f1c7b70b1d2160f6dd9fb4601 (diff) |
Always modal scroll top to 0
Diffstat (limited to 'js/tests/unit/modal.spec.js')
-rw-r--r-- | js/tests/unit/modal.spec.js | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/js/tests/unit/modal.spec.js b/js/tests/unit/modal.spec.js index c5fbc3a273..52676844f4 100644 --- a/js/tests/unit/modal.spec.js +++ b/js/tests/unit/modal.spec.js @@ -382,40 +382,40 @@ describe('Modal', () => { modal.show() }) - it('should set modal body scroll top to 0 if .modal-dialog-scrollable', done => { + it('should set .modal\'s scroll top to 0', done => { fixtureEl.innerHTML = [ '<div class="modal fade">', - ' <div class="modal-dialog modal-dialog-scrollable">', - ' <div class="modal-body"></div>', + ' <div class="modal-dialog">', ' </div>', '</div>' ].join('') const modalEl = fixtureEl.querySelector('.modal') - const modalBody = modalEl.querySelector('.modal-body') const modal = new Modal(modalEl) modalEl.addEventListener('shown.bs.modal', () => { - expect(modalBody.scrollTop).toEqual(0) + expect(modalEl.scrollTop).toEqual(0) done() }) modal.show() }) - it('should set .modal\'s scroll top to 0 if .modal-dialog-scrollable and modal body do not exists', done => { + it('should set modal body scroll top to 0 if modal body do not exists', done => { fixtureEl.innerHTML = [ '<div class="modal fade">', - ' <div class="modal-dialog modal-dialog-scrollable">', + ' <div class="modal-dialog">', + ' <div class="modal-body"></div>', ' </div>', '</div>' ].join('') const modalEl = fixtureEl.querySelector('.modal') + const modalBody = modalEl.querySelector('.modal-body') const modal = new Modal(modalEl) modalEl.addEventListener('shown.bs.modal', () => { - expect(modalEl.scrollTop).toEqual(0) + expect(modalBody.scrollTop).toEqual(0) done() }) |