From: Heinrich Fenkart Date: Wed, 18 Jun 2014 19:33:49 +0000 (+0200) Subject: Clean carousel unit tests up X-Git-Tag: v3.3.0~379^2~2^2~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6a523bf99d561c99e51bd2f85f3ee6bdbdbc8ffd;p=thirdparty%2Fbootstrap.git Clean carousel unit tests up --- 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() $('