From 0463b0128286a2882f97aff34ac40298e04707bd Mon Sep 17 00:00:00 2001 From: Johann-S Date: Sun, 6 Nov 2016 14:48:55 +0100 Subject: Close #21090 - Fix aria-pressed attribute for buttons in container with data-toggle='buttons' --- js/tests/unit/button.js | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'js/tests/unit/button.js') diff --git a/js/tests/unit/button.js b/js/tests/unit/button.js index d87b57610..c67cea345 100644 --- a/js/tests/unit/button.js +++ b/js/tests/unit/button.js @@ -60,6 +60,17 @@ $(function () { assert.strictEqual($btn.attr('aria-pressed'), 'true', 'btn aria-pressed state is true') }) + QUnit.test('should toggle aria-pressed on buttons with container', function (assert) { + assert.expect(1) + var groupHTML = '
' + + '' + + '' + + '
' + $('#qunit-fixture').append(groupHTML) + $('#btn1').bootstrapButton('toggle') + assert.strictEqual($('#btn1').attr('aria-pressed'), 'true') + }) + QUnit.test('should toggle aria-pressed when btn children are clicked', function (assert) { assert.expect(2) var $btn = $('') -- cgit v1.2.3 From 3f6e1faf45d503d670e01b600a0455e2da0fe660 Mon Sep 17 00:00:00 2001 From: "Patrick H. Lauke" Date: Mon, 10 Apr 2017 14:43:54 +0100 Subject: Only change aria-pressed if it's not an input-based radio or checkbox group * Only change aria-pressed if it's not an input-based radio or checkbox group aria-pressed="true"/aria-pressed="false" is really only useful for making on/off toggles out of, say, `