]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Add failing test
authorDavid Bailey <techdavid@users.noreply.github.com>
Tue, 29 Aug 2017 14:36:37 +0000 (15:36 +0100)
committerDavid Bailey <techdavid@users.noreply.github.com>
Tue, 29 Aug 2017 14:36:37 +0000 (15:36 +0100)
js/tests/unit/modal.js

index 5b265df15891db3765a4d16a3c196ca628522ba5..d22b818d2687f6bdb0bbda783b0ccc7c246c5985 100644 (file)
@@ -349,6 +349,20 @@ $(function () {
     $toggleBtn.trigger('click')
   })
 
+  QUnit.test('should adjust the inline padding of the modal when opening', function (assert) {
+    assert.expect(1)
+    var done = assert.async()
+
+    $('<div id="modal-test"/>')
+      .on('shown.bs.modal', function () {
+        var expectedPadding = $(this).getScrollbarWidth() + 'px'
+        var currentPadding = $(this).css('padding-right')
+        assert.strictEqual(currentPadding, expectedPadding, 'modal padding should be adjusted while opening')
+        done()
+      })
+      .bootstrapModal('show')
+  })
+
   QUnit.test('should adjust the inline body padding when opening and restore when closing', function (assert) {
     assert.expect(2)
     var done = assert.async()