From 1ef5fa7d6b4e50230c0c12919b0a06a9a2ac07f1 Mon Sep 17 00:00:00 2001 From: Jacob Thornton Date: Tue, 20 Dec 2011 18:02:47 -0800 Subject: giant refactor - all spec passing again... --- js/tests/unit/bootstrap-tab.js | 46 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 js/tests/unit/bootstrap-tab.js (limited to 'js/tests/unit/bootstrap-tab.js') diff --git a/js/tests/unit/bootstrap-tab.js b/js/tests/unit/bootstrap-tab.js new file mode 100644 index 000000000..f32649078 --- /dev/null +++ b/js/tests/unit/bootstrap-tab.js @@ -0,0 +1,46 @@ +$(function () { + + module("bootstrap-tabs") + + test("should be defined on jquery object", function () { + ok($(document.body).tab, 'tabs method is defined') + }) + + test("should return element", function () { + ok($(document.body).tab()[0] == document.body, 'document.body returned') + }) + + test("should activate element by tab id", function () { + var tabsHTML = + '' + + + $('').appendTo("#qunit-fixture") + + $(tabsHTML).find('li:last a').tab('show') + equals($("#qunit-fixture").find('.active').attr('id'), "profile") + + $(tabsHTML).find('li:first a').tab('show') + equals($("#qunit-fixture").find('.active').attr('id'), "home") + }) + + test("should activate element by tab id", function () { + var pillsHTML = + '' + + $('').appendTo("#qunit-fixture") + + $(pillsHTML).find('li:last a').tab('show') + equals($("#qunit-fixture").find('.active').attr('id'), "profile") + + $(pillsHTML).find('li:first a').tab('show') + equals($("#qunit-fixture").find('.active').attr('id'), "home") + }) + +}) \ No newline at end of file -- cgit v1.2.3 From e61164e67a048c20c512e99335e3adfcc3b63604 Mon Sep 17 00:00:00 2001 From: Jacob Thornton Date: Sat, 28 Jan 2012 01:35:13 -0800 Subject: all unit tests passing in ie7 --- js/tests/unit/bootstrap-tab.js | 1 - 1 file changed, 1 deletion(-) (limited to 'js/tests/unit/bootstrap-tab.js') diff --git a/js/tests/unit/bootstrap-tab.js b/js/tests/unit/bootstrap-tab.js index f32649078..18f490fa5 100644 --- a/js/tests/unit/bootstrap-tab.js +++ b/js/tests/unit/bootstrap-tab.js @@ -17,7 +17,6 @@ $(function () { + '
  • Profile
  • ' + '' - $('').appendTo("#qunit-fixture") $(tabsHTML).find('li:last a').tab('show') -- cgit v1.2.3