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-collapse.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 js/tests/unit/bootstrap-collapse.js (limited to 'js/tests/unit/bootstrap-collapse.js') diff --git a/js/tests/unit/bootstrap-collapse.js b/js/tests/unit/bootstrap-collapse.js new file mode 100644 index 000000000..698238d96 --- /dev/null +++ b/js/tests/unit/bootstrap-collapse.js @@ -0,0 +1,25 @@ +$(function () { + + module("bootstrap-collapse") + + test("should be defined on jquery object", function () { + ok($(document.body).collapse, 'collapse method is defined') + }) + + test("should return element", function () { + ok($(document.body).collapse()[0] == document.body, 'document.body returned') + }) + + test("should show a collapsed element", function () { + var el = $('
').collapse('show') + ok(el.hasClass('in'), 'has class in') + ok(/height/.test(el.attr('style')), 'has height set') + }) + + test("should hide a collapsed element", function () { + var el = $('
').collapse('hide') + ok(!el.hasClass('in'), 'does not have class in') + ok(/height/.test(el.attr('style')), 'has height set') + }) + +}) \ No newline at end of file -- cgit v1.2.3