]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Add unit test for #9920
authorNathan Muir <ndmuir@gmail.com>
Tue, 3 Sep 2013 02:23:51 +0000 (12:23 +1000)
committerChris Rebert <code@rebertia.com>
Mon, 11 Nov 2013 01:23:11 +0000 (17:23 -0800)
Merges #10385

js/tests/unit/button.js

index 16284e0ceda0fb4f1b4d08e11309cdb3ac069b50..115edefafd80284511d74c3b0838a879fe151be9 100644 (file)
@@ -111,6 +111,12 @@ $(function () {
         ok(!btn1.find('input').prop('checked'), 'btn1 is checked')
         ok(btn2.hasClass('active'), 'btn2 has active class')
         ok(btn2.find('input').prop('checked'), 'btn2 is checked')
+
+        btn2.find('input').click() /* clicking an already checked radio should not un-check it */
+        ok(!btn1.hasClass('active'), 'btn1 does not have active class')
+        ok(!btn1.find('input').prop('checked'), 'btn1 is checked')
+        ok(btn2.hasClass('active'), 'btn2 has active class')
+        ok(btn2.find('input').prop('checked'), 'btn2 is checked')
       })
 
 })