From 6a523bf99d561c99e51bd2f85f3ee6bdbdbc8ffd Mon Sep 17 00:00:00 2001 From: Heinrich Fenkart Date: Wed, 18 Jun 2014 21:33:49 +0200 Subject: [PATCH] Clean carousel unit tests up --- js/tests/unit/carousel.js | 380 +++++++++++++++++++++++++++++--------- 1 file changed, 291 insertions(+), 89 deletions(-) diff --git a/js/tests/unit/carousel.js b/js/tests/unit/carousel.js index 474cfb40c7..1f2fce30b3 100644 --- a/js/tests/unit/carousel.js +++ b/js/tests/unit/carousel.js @@ -19,156 +19,358 @@ $(function () { }) test('should provide no conflict', function () { - ok(!$.fn.carousel, 'carousel was set back to undefined (orig value)') + strictEqual($.fn.carousel, undefined, 'carousel was set back to undefined (orig value)') }) - test('should return element', function () { - ok($(document.body).bootstrapCarousel()[0] == document.body, 'document.body returned') + test('should return jquery collection containing the element', function () { + var $el = $('
') + var $carousel = $el.bootstrapCarousel() + ok($carousel instanceof $, 'returns jquery collection') + strictEqual($carousel[0], $el[0], 'collection contains element') }) - test('should not fire slide when slide is prevented', function () { - $.support.transition = false + test('should not fire slid when slide is prevented', function () { stop() $('