aboutsummaryrefslogtreecommitdiff
path: root/js/tests/unit/bootstrap-tabs.js
diff options
context:
space:
mode:
authorJacob Thornton <[email protected]>2012-01-31 13:18:34 -0800
committerJacob Thornton <[email protected]>2012-01-31 13:18:34 -0800
commit0bfbe5058d61ae93d82b09f1dff7eb30dc22426e (patch)
tree6ccf3dd9c36ff4b1f6cde5edbce21cdf0de78497 /js/tests/unit/bootstrap-tabs.js
parent43cbc9440425b7c97c943690eefd14520de708e1 (diff)
parent4bd1ba4e0dc44d1d16161306576548f378ab1f8a (diff)
downloadbootstrap-0bfbe5058d61ae93d82b09f1dff7eb30dc22426e.tar.xz
bootstrap-0bfbe5058d61ae93d82b09f1dff7eb30dc22426e.zip
Merge branch '2.0-wip'
Conflicts: .gitignore LICENSE Makefile bootstrap.css bootstrap.min.css docs/assets/js/application.js docs/assets/js/google-code-prettify/prettify.css docs/index.html docs/javascript.html examples/container-app.html examples/fluid.html examples/hero.html js/bootstrap-alerts.js js/bootstrap-dropdown.js js/bootstrap-modal.js js/bootstrap-popover.js js/bootstrap-scrollspy.js js/bootstrap-tabs.js js/bootstrap-twipsy.js js/tests/index.html js/tests/unit/bootstrap-modal.js js/tests/unit/bootstrap-popover.js js/tests/unit/bootstrap-tabs.js lib/forms.less lib/mixins.less lib/patterns.less lib/scaffolding.less lib/tables.less
Diffstat (limited to 'js/tests/unit/bootstrap-tabs.js')
-rw-r--r--js/tests/unit/bootstrap-tabs.js77
1 files changed, 0 insertions, 77 deletions
diff --git a/js/tests/unit/bootstrap-tabs.js b/js/tests/unit/bootstrap-tabs.js
deleted file mode 100644
index 1d024ecbb..000000000
--- a/js/tests/unit/bootstrap-tabs.js
+++ /dev/null
@@ -1,77 +0,0 @@
-$(function () {
-
- module("bootstrap-tabs")
-
- test("should be defined on jquery object", function () {
- ok($(document.body).tabs, 'tabs method is defined')
- })
-
- test("should return element", function () {
- ok($(document.body).tabs()[0] == document.body, 'document.body returned')
- })
-
- test("should activate element by tab id", function () {
- var $tabsHTML = $('<ul class="tabs">'
- + '<li class="active"><a href="#home">Home</a></li>'
- + '<li><a href="#profile">Profile</a></li>'
- + '</ul>')
-
-
- $('<ul><li id="home"></li><li id="profile"></li></ul>').appendTo("#qunit-runoff")
-
- $tabsHTML.tabs().find('a').last().click()
- equals($("#qunit-runoff").find('.active').attr('id'), "profile")
-
- $tabsHTML.tabs().find('a').first().click()
- equals($("#qunit-runoff").find('.active').attr('id'), "home")
-
- $("#qunit-runoff").empty()
- })
-
- test("should activate element by pill id", function () {
- var $pillsHTML = $('<ul class="pills">'
- + '<li class="active"><a href="#home">Home</a></li>'
- + '<li><a href="#profile">Profile</a></li>'
- + '</ul>')
-
-
- $('<ul><li id="home"></li><li id="profile"></li></ul>').appendTo("#qunit-runoff")
-
- $pillsHTML.pills().find('a').last().click()
- equals($("#qunit-runoff").find('.active').attr('id'), "profile")
-
- $pillsHTML.pills().find('a').first().click()
- equals($("#qunit-runoff").find('.active').attr('id'), "home")
-
- $("#qunit-runoff").empty()
- })
-
- test( "should trigger change event on activate", function () {
- var $tabsHTML = $('<ul class="tabs">'
- + '<li class="active"><a href="#home">Home</a></li>'
- + '<li><a href="#profile">Profile</a></li>'
- + '</ul>')
- , $target
- , count = 0
- , relatedTarget
- , target
-
- $tabsHTML
- .tabs()
- .bind( "change", function (e) {
- target = e.target
- relatedTarget = e.relatedTarget
- count++
- })
-
- $target = $tabsHTML
- .find('a')
- .last()
- .click()
-
- equals(relatedTarget, $tabsHTML.find('a').first()[0])
- equals(target, $target[0])
- equals(count, 1)
- })
-
-}) \ No newline at end of file