aboutsummaryrefslogtreecommitdiff
path: root/js/tests
diff options
context:
space:
mode:
authorMark Otto <[email protected]>2012-02-19 14:54:53 -0800
committerMark Otto <[email protected]>2012-02-19 14:54:53 -0800
commitadbbf17ee4a241b14503289e6726fc52acefc8a4 (patch)
treeac7cc57aca1e989f6b72f0311660b7d2a458884a /js/tests
parent16d12396d0f1f352280ae195ac60a15e7e95d666 (diff)
parent532242e626c36beb3985e23f3f119373db21262a (diff)
downloadbootstrap-adbbf17ee4a241b14503289e6726fc52acefc8a4.tar.xz
bootstrap-adbbf17ee4a241b14503289e6726fc52acefc8a4.zip
Merge branch '2.0.2-wip' of github.com:twitter/bootstrap into 2.0.2-wip
Conflicts: docs/assets/bootstrap.zip
Diffstat (limited to 'js/tests')
-rw-r--r--js/tests/unit/bootstrap-button.js25
1 files changed, 24 insertions, 1 deletions
diff --git a/js/tests/unit/bootstrap-button.js b/js/tests/unit/bootstrap-button.js
index 8aed857e1..03c4a8e9d 100644
--- a/js/tests/unit/bootstrap-button.js
+++ b/js/tests/unit/bootstrap-button.js
@@ -45,10 +45,33 @@ $(function () {
})
test("should toggle active", function () {
- var btn = $('<button class="btn" data-loading-text="fat">mdo</button>')
+ var btn = $('<button class="btn">mdo</button>')
ok(!btn.hasClass('active'), 'btn does not have active class')
btn.button('toggle')
ok(btn.hasClass('active'), 'btn has class active')
})
+ test("should toggle active when btn children are clicked", function () {
+ var btn = $('<button class="btn" data-toggle="button">mdo</button>')
+ , inner = $('<i></i>')
+ btn
+ .append(inner)
+ .appendTo($('#qunit-fixture'))
+ ok(!btn.hasClass('active'), 'btn does not have active class')
+ inner.click()
+ ok(btn.hasClass('active'), 'btn has class active')
+ })
+
+ test("should toggle active when btn children are clicked within btn-group", function () {
+ var btngroup = $('<div class="btn-group" data-toggle="buttons-checkbox"></div>')
+ , btn = $('<button class="btn">fat</button>')
+ , inner = $('<i></i>')
+ btngroup
+ .append(btn.append(inner))
+ .appendTo($('#qunit-fixture'))
+ ok(!btn.hasClass('active'), 'btn does not have active class')
+ inner.click()
+ ok(btn.hasClass('active'), 'btn has class active')
+ })
+
}) \ No newline at end of file