diff options
| author | Mark Otto <[email protected]> | 2017-04-16 14:03:25 -0700 |
|---|---|---|
| committer | Mark Otto <[email protected]> | 2017-04-16 14:03:25 -0700 |
| commit | 570efe1df6620c9bd6e70cf0bd8d87e42ac6e892 (patch) | |
| tree | e4a0600341e579a45d4e2fe550362656d503490d /js/tests/unit/button.js | |
| parent | 0cb2576bf25220d35a5f4e1d33c16c2e6f3abaee (diff) | |
| parent | ea1d69c64be168bb644ae9fc4450a5c85b51609b (diff) | |
| download | bootstrap-570efe1df6620c9bd6e70cf0bd8d87e42ac6e892.tar.xz bootstrap-570efe1df6620c9bd6e70cf0bd8d87e42ac6e892.zip | |
Merge branch 'v4-dev' into form-tweaks
Diffstat (limited to 'js/tests/unit/button.js')
| -rw-r--r-- | js/tests/unit/button.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/js/tests/unit/button.js b/js/tests/unit/button.js index c67cea345..abc04e10a 100644 --- a/js/tests/unit/button.js +++ b/js/tests/unit/button.js @@ -138,4 +138,22 @@ $(function () { assert.ok($btn2.find('input').prop('checked'), 'btn2 is checked') }) + QUnit.test('should not add aria-pressed on labels for radio/checkbox inputs in a data-toggle="buttons" group', function (assert) { + assert.expect(2) + var groupHTML = '<div class="btn-group" data-toggle="buttons">' + + '<label class="btn btn-primary"><input type="checkbox" autocomplete="off"> Checkbox</label>' + + '<label class="btn btn-primary"><input type="radio" name="options" autocomplete="off"> Radio</label>' + + '</div>' + var $group = $(groupHTML).appendTo('#qunit-fixture') + + var $btn1 = $group.children().eq(0) + var $btn2 = $group.children().eq(1) + + $btn1.find('input').trigger('click') + assert.ok($btn1.is(':not([aria-pressed])'), 'label for nested checkbox input has not been given an aria-pressed attribute') + + $btn2.find('input').trigger('click') + assert.ok($btn2.is(':not([aria-pressed])'), 'label for nested radio input has not been given an aria-pressed attribute') + }) + }) |
