diff options
| author | Mark Otto <[email protected]> | 2016-06-02 21:48:53 -0700 |
|---|---|---|
| committer | Mark Otto <[email protected]> | 2016-06-02 21:48:53 -0700 |
| commit | 8feae9075ae55be4e6cd0e884fbfa006a6639ceb (patch) | |
| tree | 0124594afc748b650fbe2f840b1e8d4cabc841cf /js/tests/unit | |
| parent | 96835e1512631a1a54e99e1179e06d2e23060705 (diff) | |
| parent | 0b4187d37b8fb1a65a5929329b51b04a2d6aa1eb (diff) | |
| download | bootstrap-8feae9075ae55be4e6cd0e884fbfa006a6639ceb.tar.xz bootstrap-8feae9075ae55be4e6cd0e884fbfa006a6639ceb.zip | |
Merge branch 'v4-dev' of https://github.com/twbs/bootstrap into v4-dev
Diffstat (limited to 'js/tests/unit')
| -rw-r--r-- | js/tests/unit/scrollspy.js | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/js/tests/unit/scrollspy.js b/js/tests/unit/scrollspy.js index 878c4d389..ccb3e6d9c 100644 --- a/js/tests/unit/scrollspy.js +++ b/js/tests/unit/scrollspy.js @@ -81,7 +81,7 @@ $(function () { .find('#scrollspy-example') .bootstrapScrollspy({ target: '#ss-target' }) - $scrollspy.on('scroll.bs.scrollspy', function () { + $scrollspy.one('scroll', function () { assert.ok($section.hasClass('active'), '"active" class still on root node') done() }) @@ -126,7 +126,7 @@ $(function () { .find('#scrollspy-example') .bootstrapScrollspy({ target: document.getElementById('#ss-target') }) - $scrollspy.on('scroll.bs.scrollspy', function () { + $scrollspy.one('scroll', function () { assert.ok($section.hasClass('active'), '"active" class still on root node') done() }) @@ -158,7 +158,7 @@ $(function () { $scrollspy.bootstrapScrollspy({ target: '#navigation', offset: $scrollspy.position().top }) - $scrollspy.on('scroll.bs.scrollspy', function () { + $scrollspy.one('scroll', function () { assert.ok(!$section.find('#one-link').hasClass('active'), '"active" class removed from first section') assert.ok($section.find('#two-link').hasClass('active'), '"active" class on middle section') assert.ok(!$section.find('#three-link').hasClass('active'), '"active" class not on last section') @@ -272,11 +272,11 @@ $(function () { target: '#navigation', offset: $scrollspy.position().top }) - .one('scroll.bs.scrollspy', function () { + .one('scroll', function () { assert.strictEqual($('.active').length, 1, '"active" class on only one element present') assert.strictEqual($('.active').is('#two-link'), true, '"active" class on second section') $scrollspy - .one('scroll.bs.scrollspy', function () { + .one('scroll', function () { assert.strictEqual($('.active').length, 0, 'selection cleared') done() }) @@ -357,12 +357,12 @@ $(function () { .appendTo('#qunit-fixture') if (type === 'js') $content.bootstrapScrollspy({ target: '.navbar', offset: 0, method: 'offset' }) - else if (type === 'data') $(window).trigger('load.bs.scrollspy.data-api') + else if (type === 'data') $(window).trigger('load') var $target = $('#div-' + type + 'm-2') var scrollspy = $content.data('bs.scrollspy') - assert.ok(scrollspy._offsets[1] === $target.offset().top, 'offsed method with ' + type + ' option') + assert.ok(scrollspy._offsets[1] === $target.offset().top, 'offset method with ' + type + ' option') assert.ok(scrollspy._offsets[1] !== $target.position().top, 'position method with ' + type + ' option') deferred.resolve() @@ -400,12 +400,12 @@ $(function () { .appendTo('#qunit-fixture') if (type === 'js') $content.bootstrapScrollspy({ target: '.navbar', offset: 0, method: 'position' }) - else if (type === 'data') $(window).trigger('load.bs.scrollspy.data-api') + else if (type === 'data') $(window).trigger('load') var $target = $('#div-' + type + 'm-2') var scrollspy = $content.data('bs.scrollspy') - assert.ok(scrollspy._offsets[1] !== $target.offset().top, 'offsed method with ' + type + ' option') + assert.ok(scrollspy._offsets[1] !== $target.offset().top, 'offset method with ' + type + ' option') assert.ok(scrollspy._offsets[1] === $target.position().top, 'position method with ' + type + ' option') deferred.resolve() |
