aboutsummaryrefslogtreecommitdiff
path: root/js/tests/unit/button.js
diff options
context:
space:
mode:
authorPierre Vanduynslager <[email protected]>2017-04-10 11:04:05 -0400
committerGitHub <[email protected]>2017-04-10 11:04:05 -0400
commit025ddb185e863e40d455325c539afc5c3dbedc41 (patch)
tree85803bb95a20cd665e605b4ef8c2e939666d84de /js/tests/unit/button.js
parentd3fbebefcd8a0931f51341c8fe59a075578753c8 (diff)
parent18e8704221791e70d0bf4ac9ff45d4e897a02e63 (diff)
downloadbootstrap-025ddb185e863e40d455325c539afc5c3dbedc41.tar.xz
bootstrap-025ddb185e863e40d455325c539afc5c3dbedc41.zip
Merge branch 'v4-dev' into dropdown-keyboard
Diffstat (limited to 'js/tests/unit/button.js')
-rw-r--r--js/tests/unit/button.js18
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')
+ })
+
})