From 33715a73d2eae3865cb4c1e0a13d1da4b6aeb278 Mon Sep 17 00:00:00 2001 From: Anna Date: Wed, 26 Apr 2017 19:46:05 +0300 Subject: Fix Toggle buttons don't honor [disabled] or .disabled --- js/tests/unit/button.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'js/tests/unit/button.js') 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 = '
' + + '' + + '
' + 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') + }) + }) -- cgit v1.2.3