From c72a315740c852152c1bc6a34bf2b4c2372fe389 Mon Sep 17 00:00:00 2001 From: Johann Date: Wed, 22 Mar 2017 22:42:13 +0100 Subject: Carousel - Add attributes from and to for Slid and Slide events (#21668) Carousel - Add attributes from and to for Slid and Slide events --- js/tests/unit/carousel.js | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'js/tests/unit/carousel.js') 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 = '' + + 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 = '