diff options
| author | fat <[email protected]> | 2014-03-24 19:15:58 -0700 |
|---|---|---|
| committer | fat <[email protected]> | 2014-03-24 19:23:39 -0700 |
| commit | 4a2d337bf5f329eac1ca16208414ec1ebfe0546e (patch) | |
| tree | d910ebaae13d5fca3036f2b122579233c5253606 /js/tests/unit | |
| parent | b3f30bb70efc5211520d7a55596becebc5d14662 (diff) | |
| download | bootstrap-4a2d337bf5f329eac1ca16208414ec1ebfe0546e.tar.xz bootstrap-4a2d337bf5f329eac1ca16208414ec1ebfe0546e.zip | |
fixes #9461 - Make carousel ignore non-items in carousel-inner
Diffstat (limited to 'js/tests/unit')
| -rw-r--r-- | js/tests/unit/carousel.js | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/js/tests/unit/carousel.js b/js/tests/unit/carousel.js index 6f69855c7..562e30255 100644 --- a/js/tests/unit/carousel.js +++ b/js/tests/unit/carousel.js @@ -107,4 +107,32 @@ $(function () { ok($('#myCarousel').data('bs.carousel').options.interval === false, 'data attribute has higher priority than default options') $('#myCarousel').remove() }) + + test('should skip over non-items', function () { + $.support.transition = false + + var $template = $( + '<div id="myCarousel" class="carousel" data-interval="1814">' + + '<div class="carousel-inner">' + + '<div class="item active">' + + '<img alt="">' + + '</div>' + + '<script type="text/x-metamorph" id="thingy"></script>' + + '<div class="item">' + + '<img alt="">' + + '</div>' + + '<div class="item">' + + '</div>' + + '</div>' + + '</div>' + ) + + $template.carousel() + + equal($template.find('.item')[0], $template.find('.active')[0], 'the first carousel item should be active') + + $template.carousel(1) + + equal($template.find('.item')[1], $template.find('.active')[0], 'the second carousel item should be active') + }) }) |
