diff options
| author | Mark Otto <[email protected]> | 2017-05-01 21:54:50 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2017-05-01 21:54:50 -0700 |
| commit | 8c7fe6cf147e98fb5d8096f6e6536bcb4e207586 (patch) | |
| tree | d33635083f70814945e92cb17957b6c522073379 /js/tests/unit/button.js | |
| parent | ca44f5b03a9707dda74e1aa3f92a1b54de3ec6d5 (diff) | |
| parent | e00de46540818fa11feb6d1f0e8b0089ba56f082 (diff) | |
| download | bootstrap-8c7fe6cf147e98fb5d8096f6e6536bcb4e207586.tar.xz bootstrap-8c7fe6cf147e98fb5d8096f6e6536bcb4e207586.zip | |
Merge branch 'v4-dev' into form-tweaks
Diffstat (limited to 'js/tests/unit/button.js')
| -rw-r--r-- | js/tests/unit/button.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/js/tests/unit/button.js b/js/tests/unit/button.js index abc04e10a..489d400a6 100644 --- a/js/tests/unit/button.js +++ b/js/tests/unit/button.js @@ -156,4 +156,21 @@ $(function () { assert.ok($btn2.is(':not([aria-pressed])'), 'label for nested radio input has not been given an aria-pressed attribute') }) + QUnit.test('should handle disabled attribute on non-button elements', function (assert) { + assert.expect(2) + var groupHTML = ' <div class="btn-group disabled" data-toggle="buttons" aria-disabled="true" disabled>' + + '<label class="btn btn-danger disabled" aria-disabled="true" disabled>' + + '<input type="checkbox" aria-disabled="true" autocomplete="off" disabled class="disabled"/>' + + '</label>' + + '</div>' + var $group = $(groupHTML).appendTo('#qunit-fixture') + + var $btn = $group.children().eq(0) + var $input = $btn.children().eq(0) + + $btn.trigger('click') + assert.ok($btn.is(':not(.active)'), 'button did not become active') + assert.ok(!$input.is(':checked'), 'checkbox did not get checked') + }) + }) |
