aboutsummaryrefslogtreecommitdiff
path: root/js/tests
diff options
context:
space:
mode:
authorJohann-S <[email protected]>2016-11-06 14:48:55 +0100
committerJohann-S <[email protected]>2017-01-04 11:02:16 +0100
commit0463b0128286a2882f97aff34ac40298e04707bd (patch)
tree59407b07f4e3a34de98555a3b894658ab3137099 /js/tests
parent1b194c06607f6cc3d087d25d6d49e1698771f3a1 (diff)
downloadbootstrap-0463b0128286a2882f97aff34ac40298e04707bd.tar.xz
bootstrap-0463b0128286a2882f97aff34ac40298e04707bd.zip
Close #21090 - Fix aria-pressed attribute for buttons in container with data-toggle='buttons'
Diffstat (limited to 'js/tests')
-rw-r--r--js/tests/unit/button.js11
1 files changed, 11 insertions, 0 deletions
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 = '<div class="btn-group" data-toggle="buttons">' +
+ '<button id="btn1" class="btn btn-secondary" type="button">One</button>' +
+ '<button class="btn btn-secondary" type="button">Two</button>' +
+ '</div>'
+ $('#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 = $('<button class="btn" data-toggle="button" aria-pressed="false">redux</button>')