aboutsummaryrefslogtreecommitdiff
path: root/js/tests
diff options
context:
space:
mode:
authordmitriybudnik <[email protected]>2012-10-15 21:55:32 +0300
committerdmitriybudnik <[email protected]>2012-10-15 22:35:32 +0300
commit432eaff29cc05f488fc0a1c87d1e28d86ef3641e (patch)
treec64c50d3450f21365420568f0f5fc8fe3610df6b /js/tests
parent7e534ce98acf03229e09b8ae478cb3598d3882cd (diff)
downloadbootstrap-432eaff29cc05f488fc0a1c87d1e28d86ef3641e.tar.xz
bootstrap-432eaff29cc05f488fc0a1c87d1e28d86ef3641e.zip
Fixed copy/paste caused typo
Diffstat (limited to 'js/tests')
-rw-r--r--js/tests/unit/bootstrap-carousel.js22
1 files changed, 21 insertions, 1 deletions
diff --git a/js/tests/unit/bootstrap-carousel.js b/js/tests/unit/bootstrap-carousel.js
index 5ac9fb2d8..fbcbb5b17 100644
--- a/js/tests/unit/bootstrap-carousel.js
+++ b/js/tests/unit/bootstrap-carousel.js
@@ -37,6 +37,26 @@ $(function () {
start();
})
.carousel('next')
- })
+ test("should set interval from data attribute", 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">&lsaquo;</a> <a class="right carousel-control" href="#myCarousel" data-slide="next">&rsaquo;</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