diff options
| author | Pierre Vanduynslager <[email protected]> | 2017-04-08 18:43:25 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2017-04-08 18:43:25 -0400 |
| commit | fe72daf2b34263d3cfc9bc77e9998cd22adfa34d (patch) | |
| tree | 15dc9fc6fcb513362ba112d52ab01b568b423709 /js/tests/unit/carousel.js | |
| parent | f5cc59145642d78d7abbdf38fee1905786da5367 (diff) | |
| parent | feb35b94a61c4d6016be8d1773a79a6bbe57d856 (diff) | |
| download | bootstrap-fe72daf2b34263d3cfc9bc77e9998cd22adfa34d.tar.xz bootstrap-fe72daf2b34263d3cfc9bc77e9998cd22adfa34d.zip | |
Merge branch 'v4-dev' into dropdown-keyboard
Diffstat (limited to 'js/tests/unit/carousel.js')
| -rw-r--r-- | js/tests/unit/carousel.js | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/js/tests/unit/carousel.js b/js/tests/unit/carousel.js index dbdea921a..00b438bb2 100644 --- a/js/tests/unit/carousel.js +++ b/js/tests/unit/carousel.js @@ -341,6 +341,49 @@ $(function () { .bootstrapCarousel('next') }) + QUnit.test('should fire slid and slide events with from and to', function (assert) { + assert.expect(4) + var template = '<div id="myCarousel" class="carousel slide">' + + '<div class="carousel-inner">' + + '<div class="carousel-item active">' + + '<img alt="">' + + '<div class="carousel-caption">' + + '<h4>First Thumbnail label</h4>' + + '</div>' + + '</div>' + + '<div class="carousel-item">' + + '<img alt="">' + + '<div class="carousel-caption">' + + '<h4>Second Thumbnail label</h4>' + + '</div>' + + '</div>' + + '<div class="carousel-item">' + + '<img alt="">' + + '<div class="carousel-caption">' + + '<h4>Third Thumbnail label</h4>' + + '</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>' + + var done = assert.async() + $(template) + .on('slid.bs.carousel', function (e) { + assert.ok(e.from !== undefined, 'from present') + assert.ok(e.to !== undefined, 'to present') + $(this).off() + done() + }) + .on('slide.bs.carousel', function (e) { + assert.ok(e.from !== undefined, 'from present') + assert.ok(e.to !== undefined, 'to present') + $(this).off('slide.bs.carousel') + }) + .bootstrapCarousel('next') + }) + QUnit.test('should set interval from data attribute', function (assert) { assert.expect(4) var templateHTML = '<div id="myCarousel" class="carousel slide">' |
