From 0b78f465d39b87d24d7ddba9b20374017e902672 Mon Sep 17 00:00:00 2001 From: Andrew Luca Date: Sun, 14 Oct 2018 22:39:40 +0300 Subject: [PATCH] test: ensure .navbar-fixed-* padding on modal open --- js/tests/unit/modal.js | 76 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/js/tests/unit/modal.js b/js/tests/unit/modal.js index dc14942455..a38d0fe582 100644 --- a/js/tests/unit/modal.js +++ b/js/tests/unit/modal.js @@ -387,4 +387,80 @@ $(function () { }) .bootstrapModal('show') }) + + QUnit.test('should add padding-right of scrollbar width to .navbar-fixed-top and .navbar-fixed-bottom before open', function (assert) { + assert.expect(2) + var Modal = $.fn.bootstrapModal.Constructor + var done = assert.async() + var $body = $(document.body) + var scrollbarWidth + + // simulate overflow scroll + $body.css({ height: '2000px' }) + + var $fixedTop = $('