diff options
| author | billy gates <[email protected]> | 2012-10-17 21:25:21 -0700 |
|---|---|---|
| committer | billy gates <[email protected]> | 2012-10-17 21:25:21 -0700 |
| commit | 97bf02d78791c08a7d459d532ca3ce9ec8d457a1 (patch) | |
| tree | 7f6b99aaf50a72868b1ab4e063029c8bd2b311d2 /js/tests | |
| parent | 3074737d90f1f8f77e0dde3473f4bbe870a217b8 (diff) | |
| parent | ae0ba0686efcbf73116a21eb9aff3f9bede4a489 (diff) | |
| download | bootstrap-97bf02d78791c08a7d459d532ca3ce9ec8d457a1.tar.xz bootstrap-97bf02d78791c08a7d459d532ca3ce9ec8d457a1.zip | |
Merge pull request #5531 from dmitriybudnik/carousel-js-typo-fix
Fixed copy/paste caused typo
Diffstat (limited to 'js/tests')
| -rw-r--r-- | js/tests/unit/bootstrap-carousel.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/js/tests/unit/bootstrap-carousel.js b/js/tests/unit/bootstrap-carousel.js index 5ac9fb2d8..8bd1b62ba 100644 --- a/js/tests/unit/bootstrap-carousel.js +++ b/js/tests/unit/bootstrap-carousel.js @@ -39,4 +39,25 @@ $(function () { .carousel('next') }) + test("should set interval from data attribute", 3,function () { + var template = $('<div id="myCarousel" class="carousel slide"> <div class="carousel-inner"> <div class="item active"> <img alt=""> <div class="carousel-caption"> <h4>{{_i}}First Thumbnail label{{/i}}</h4> <p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p> </div> </div> <div class="item"> <img alt=""> <div class="carousel-caption"> <h4>{{_i}}Second Thumbnail label{{/i}}</h4> <p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p> </div> </div> <div class="item"> <img alt=""> <div class="carousel-caption"> <h4>{{_i}}Third Thumbnail label{{/i}}</h4> <p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p> </div> </div> </div> <a class="left carousel-control" href="#myCarousel" data-slide="prev">‹</a> <a class="right carousel-control" href="#myCarousel" data-slide="next">›</a> </div>'); + template.attr("data-interval", 1814); + + template.appendTo("body"); + $('[data-slide]').first().click(); + ok($('#myCarousel').data('carousel').options.interval == 1814); + $('#myCarousel').remove(); + + template.appendTo("body").attr("data-modal", "foobar"); + $('[data-slide]').first().click(); + ok($('#myCarousel').data('carousel').options.interval == 1814, "even if there is an data-modal attribute set"); + $('#myCarousel').remove(); + + template.appendTo("body"); + $('[data-slide]').first().click(); + $('#myCarousel').attr('data-interval', 1860); + $('[data-slide]').first().click(); + ok($('#myCarousel').data('carousel').options.interval == 1814, "attributes should be read only on intitialization"); + $('#myCarousel').remove(); + }) })
\ No newline at end of file |
