aboutsummaryrefslogtreecommitdiff
path: root/js/tests/unit/scrollspy.js
AgeCommit message (Collapse)AuthorFilesLines
2021-09-15tests: comply to the new rulesXhmikosR1-28/+28
Use `assert.strictEqual`/`assert.true`/`assert.false`
2020-09-10Comply to the new rulesXhmikosR1-2/+2
2020-05-12scrollspy.js add more testsXhmikosR1-0/+137
2020-05-07enforce element check on scrollspy targetJohann-S1-1/+1
2020-04-17Fix tests for jQuery v3.5.0.XhmikosR1-9/+9
2019-04-29fix unit tests for chrome mobileJohann-S1-4/+12
2018-05-22chore(deps): update qunit and karma-qunitJohann-S1-0/+1
2018-01-11Comply to the new rules.XhmikosR1-256/+324
2017-09-17fix(scrollspy): Spying on nested navs fails to activate for .nav-link's ↵Troy Morehouse1-0/+41
inside nav-item's (#23967) * fix(scrollspy): Handle nested navs when nav-link inside nav-item * [scrolspy] Find only child .nav-link's inside .nav-item * [scrollspyt] Add tests for nested navs with nav-link inside nav-item * fix troy-o's in test
2017-08-23Tweak ESLint rules.XhmikosR1-1/+1
2017-05-27Update nav and navbar HTML markupGeremia Taglialatela1-31/+31
According to the docs, you just need to apply the `navbar-nav` to an `<ul>` tag in a list-based navbar. In fact, `navbar-nav` seems to override all the css properties set by `nav`. Also, `nav-item` class should be used only for `<li>` tags, or in conjunction with `<a>` tags to entirely avoid the list-based approach. This commit removes the redundant `nav` class from `navbar-nav` `<ul>` tags, moves `nav-item` from `<a>` tags to `<li>` tags and properly adds `nav-item` class to `<li>` tags where missing. Refs: * https://v4-alpha.getbootstrap.com/components/navs/ * https://v4-alpha.getbootstrap.com/components/navbar/#nav
2017-04-02Tabs/Scrollspy/.nav/.list-group/.active independent of markup (<nav>, ↵Pierre Vanduynslager1-1/+155
.nav-item, <li> etc...)
2017-03-21Always append element to fixture in Scrollspy unit tests (#22234)Pierre Vanduynslager1-2/+2
2016-11-27Closes #21055: Prevents ScrollSpy from clearing active item when Safari ↵Rob Ruana1-0/+44
rubberbands (#21056) When the rubberband effect causes Safari to scroll past the top of the page, the value of scrollTop becomes negative. If the offset of the first ScrollSpy target is 0 - essentially if the target is at the top of the page - then ScrollSpy should not clear the active item. Conceptually, the first item should remain active when rubberbanding past the top of the page. This commit fixes issue #21055 by verifying the first scrollspy target is not at the top of the page before clearing the active nav-item.
2016-11-24Make JS compliant with the new ESLint rules.Bardi Harborow1-6/+8
2016-06-28ScrollSpy unit test: Use single done() in a then() instead of multiple ↵Dave Methvin1-2/+2
done()s (#20198) Fixes test flakiness on OS X Safari and Android when using jQuery 3. Fixes #20182 more Refs #20191
2016-06-27Scrollspy test: Allow for async .then() in jQuery 3; fixes #20182Dave Methvin1-2/+2
Instead of doing a new assert.async(), just do a single one for the entire test and let the .then() be async as well. Closes #20190
2016-06-26Remove unnecessary usage of Promises in non-async ScrollSpy tests (#20180)Chris Rebert1-28/+26
Closes #19906 [skip validator]
2016-05-30Fix load & scroll event usage in ScrollSpy tests (#19986)Chris Rebert1-7/+7
* Use $.one() instead of $.on() since there are no $.off()s in the code. * Remove unnecessary namespacing of listeners for the `scroll` & `load` events. These are vanilla DOM events (not custom jQuery namespaced events) and we're not using jQuery namespacing to manage these event listeners either (e.g. `$.off()`). [skip validator]
2016-05-29js/tests/unit/scrollspy.js: Fix "offsed" typos (#19985)Chris Rebert1-2/+2
[skip sauce] [skip validator]
2015-10-02Add throw error for undefined method on pluginsJohann-S1-0/+12
2015-08-18Merge branch 'v4' of github.com:twbs/derpstrap into v4Jacob Thornton1-30/+29
2015-05-13fix up testsfat1-72/+72
2015-05-13fix #15301fat1-0/+45
2015-05-13address https://github.com/twbs/bootstrap/pull/16135fat1-0/+86
2015-03-10Fixed proper navigation element selection on backward scrolling (from the ↵Maxim Andrukhovych1-0/+46
bottom to the top)
2015-03-03[Fixes #15953] Implement assert.expect in each unit testKevin Kirsche1-0/+8
[Fixes #15953] Implement `assert.expect` in each unit test
2015-03-01Handle multiple zero-offset Scrollspy elements.Caden Lovelace1-0/+38
When the first two elements in a scrollspy content block have a document offset of zero (i.e. they're hard against the top of the page), Scrollspy would switch between them on every scroll event. This could happen, for example, in a system of nested sections: ``` <section id="animals"> <section id="dogs"> Content </section> </section> ``` This ocurred because Scrollspy's check to see if it's at the end of the array of sections uses `!arr[index]`. This misses the case where `arr[index]` does exist and is zero. This commit explicitly checks the array bounds.
2015-02-26Unit tests: Use new names of module hooksHeinrich Fenkart1-2/+2
Refs #15893
2015-02-23JS unit tests: use QUnit.module() & QUnit.test() everywhereChris Rebert1-9/+9
[skip validator]
2015-02-23JS unit tests: use modern QUnit assert object everywhereChris Rebert1-15/+15
2015-01-20update JS unit tests to future-proof QUnit 1.16.0 APIChris Rebert1-12/+12
[skip validator]
2014-10-26Follow-up to e8af21c: rm unused variable in unit testHeinrich Fenkart1-1/+1
2014-10-26Clear scrollspy selection above first sectionTadeu Zagallo1-1/+42
Closes #13563 by merging it.
2014-10-07Small clean-up in scrollspy unit testHeinrich Fenkart1-21/+5
2014-08-15consistently use <nav> instead of <div> for .navbar in docsChris Rebert1-2/+2
2014-07-06fix scrollspy test in firefox mac osfat1-11/+11
2014-07-06Merge pull request #13853 from hnrch02/unit-tests-cleanupJacob1-70/+77
Major unit tests cleanup
2014-07-06jscs fixMark Otto1-1/+1
2014-07-06Merge branch 'replace-scrollspy-default-behavior-test' of ↵fat1-0/+37
git://github.com/breaddevil/bootstrap into breaddevil-replace-scrollspy-default-behavior-test Conflicts: js/tests/unit/scrollspy.js
2014-07-06Move to leading plusesHeinrich Fenkart1-48/+48
2014-07-06Mention #13500 in comment for ScrollSpy testHeinrich Fenkart1-1/+1
2014-07-06Clean scrollspy unit tests upHeinrich Fenkart1-22/+29
2014-06-06Comply to the new style.XhmikosR1-14/+16
2014-05-13Add Scrollspy maxScroll with offset test.Mike Robinet1-2/+36
2014-05-04replace js scrollspy test for default behaviorbreaddevil1-17/+37
2014-04-21#11464 - Fix JS noConflict mode - Refactor all plugins to use an internal ↵Collin Donahue-Oponski1-10/+19
reference to the jQuery plugin, because in noConflict mode you can never expect to be defined on the jQuery object
2014-04-09JS: remove unused variables.XhmikosR1-1/+1
2014-03-14Fix JSHint errorsJulian Thilo1-36/+35
X-Ref: https://github.com/twbs/bootstrap/commit/8c9739d4773c268b114296d90e61b5f4e2932517
2014-03-13Merge pull request #11453 from moodyroto/patch-1Jacob1-0/+37
fix scrollspy for targets within tabs