diff options
| author | Jacob Thornton <[email protected]> | 2012-03-24 18:20:09 -0700 |
|---|---|---|
| committer | Jacob Thornton <[email protected]> | 2012-03-24 18:20:09 -0700 |
| commit | bccc2cb7191eb54a4d67563625a748d7ecd381d4 (patch) | |
| tree | c4562643867c197b7f7f5792694e3e10aab8de52 /js/tests/unit/bootstrap-carousel.js | |
| parent | ef5ac02b698ffab3a42d21f20859b70df85543c0 (diff) | |
| download | bootstrap-bccc2cb7191eb54a4d67563625a748d7ecd381d4.tar.xz bootstrap-bccc2cb7191eb54a4d67563625a748d7ecd381d4.zip | |
add preventDefault support for all inital event types (show, close, hide, etc.) + fix small bug with scrollspy.last
Diffstat (limited to 'js/tests/unit/bootstrap-carousel.js')
| -rw-r--r-- | js/tests/unit/bootstrap-carousel.js | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/js/tests/unit/bootstrap-carousel.js b/js/tests/unit/bootstrap-carousel.js new file mode 100644 index 000000000..92c23e227 --- /dev/null +++ b/js/tests/unit/bootstrap-carousel.js @@ -0,0 +1,28 @@ +$(function () { + + module("bootstrap-carousel") + + test("should be defined on jquery object", function () { + ok($(document.body).carousel, 'carousel method is defined') + }) + + test("should return element", function () { + ok($(document.body).carousel()[0] == document.body, 'document.body returned') + }) + + test("should not fire sliden when slide is prevented", function () { + $.support.transition = false + stop(); + $('<div class="carousel"/>') + .bind('slide', function (e) { + e.preventDefault(); + ok(true); + start(); + }) + .bind('slid', function () { + ok(false); + }) + .carousel('next') + }) + +})
\ No newline at end of file |
