From 601e252074eedf89de9cb080db9c463a4b67ba77 Mon Sep 17 00:00:00 2001 From: Jacob Thornton Date: Mon, 27 Aug 2012 20:58:51 -0700 Subject: fix for #4761 --- js/tests/unit/bootstrap-button.js | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'js/tests') diff --git a/js/tests/unit/bootstrap-button.js b/js/tests/unit/bootstrap-button.js index 03c4a8e9d..b5d083499 100644 --- a/js/tests/unit/bootstrap-button.js +++ b/js/tests/unit/bootstrap-button.js @@ -62,7 +62,7 @@ $(function () { ok(btn.hasClass('active'), 'btn has class active') }) - test("should toggle active when btn children are clicked within btn-group", function () { + test("should toggle active when btn children are clicked within btn-group", function () { var btngroup = $('
') , btn = $('') , inner = $('') @@ -74,4 +74,23 @@ $(function () { ok(btn.hasClass('active'), 'btn has class active') }) + test("should check for closest matching toggle", function () { + var group = $("
") + , btn1 = $("") + , btn2 = $("") + , wrap = $("
") + + wrap.append(btn1, btn2) + + group + .append(wrap) + .appendTo($('#qunit-fixture')) + + ok(btn1.hasClass('active'), 'btn1 has active class') + ok(!btn2.hasClass('active'), 'btn2 does not have active class') + btn2.click() + ok(!btn1.hasClass('active'), 'btn1 does not have active class') + ok(btn2.hasClass('active'), 'btn2 has active class') + }) + }) \ No newline at end of file -- cgit v1.2.3