Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bootstrap 4 + jQuery 3 unit test failures/errors #20182

Closed
cvrebert opened this issue Jun 27, 2016 · 10 comments
Closed

Bootstrap 4 + jQuery 3 unit test failures/errors #20182

cvrebert opened this issue Jun 27, 2016 · 10 comments

Comments

@cvrebert
Copy link
Collaborator

Running https://github.com/twbs/bootstrap/blob/v4-dev/js/tests/index.html with jQuery v3.0.0 swapped in, I encountered the following failures/errors. Haven't yet investigated/diagnosed them.
@dmethvin Pinging you per your request in #19433.

Chrome + Safari

Intermittent test failure

(Sometimes fails earlier/later within the set of 5 assertions)

scrollspy: should correctly select navigation element on backward scrolling when each target section height is 100% (1, 2, 3) Rerun
Expected 5 assertions, but 4 were run
Source:
at HTMLDocument.<anonymous> (file:///Users/chris/code/bootstrap/js/tests/unit/scrollspy.js:288:9)
at mightThrow (file:///Users/chris/code/bootstrap/js/tests/vendor/jquery.min.js:3505:29)
at process (file:///Users/chris/code/bootstrap/js/tests/vendor/jquery.min.js:3573:12)

Intermittent console error

jQuery.Deferred exception: Cannot read property 'top' of undefined
TypeError: Cannot read property 'top' of undefined
at testElementIsActiveAfterScroll (file:///Users/chris/code/bootstrap/js/tests/unit/scrollspy.js:316:79)
at file:///Users/chris/code/bootstrap/js/tests/unit/scrollspy.js:329:34
at mightThrow (file:///Users/chris/code/bootstrap/js/tests/vendor/jquery.min.js:3505:29)
at process (file:///Users/chris/code/bootstrap/js/tests/vendor/jquery.min.js:3573:12) undefined


Firefox

Consistent test failure

scrollspy: should correctly select navigation element on backward scrolling when each target section height is 100% (1, 3, 4) Rerun
jQuery.Deferred exception: $(...).position(...) is undefined testElementIsActiveAfterScroll@file:///Users/chris/code/bootstrap/js/tests/unit/scrollspy.js:316:59
@file:///Users/chris/code/bootstrap/js/tests/unit/scrollspy.js:328:34 (or :329:34 or :330:34 ; varies between test runs)
ScrollSpy@file:///Users/chris/code/bootstrap/js/dist/scrollspy.js:91:7

Intermittent test failure

Intermittent FAIL:
scrollspy: should add the active class to the correct element (1, 1, 2) Rerun 32 ms
Expected 2 assertions, but 1 were run
Source: @file:///Users/chris/code/bootstrap/js/tests/unit/scrollspy.js:171:3 resolve/

Intermittent console error

jQuery.Deferred exception: $(...).position(...) is undefined testElementIsActiveAfterScroll@file:///Users/chris/code/bootstrap/js/tests/unit/scrollspy.js:193:59
@file:///Users/chris/code/bootstrap/js/tests/unit/scrollspy.js:205:34
ScrollSpy@file:///Users/chris/code/bootstrap/js/dist/scrollspy.js:91:7


IE and MS Edge

Not Yet Tested.

@dmethvin
Copy link
Contributor

@cvrebert I'll take a look and let you know what's up. I can also test in Edge and IE.

@dmethvin
Copy link
Contributor

I think the PR should fix it. Worked fine in IE11 and Edge as well.

cvrebert pushed a commit that referenced this issue Jun 28, 2016
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
@cvrebert
Copy link
Collaborator Author

Fixed by #20190.

@cvrebert
Copy link
Collaborator Author

cvrebert commented Jun 28, 2016

Per #20191 (comment), we're still getting the "scrollspy: should add the active class to the correct element" failure on OS X Safari and Chrome-based Android 5.1 sometimes.
We probably just need to apply the same "only one done" fix as #20190.

@dmethvin
Copy link
Contributor

I'm on it!

@TheBuzzer67
Copy link

TheBuzzer67 commented Jun 28, 2016

Why I still have this notification?

Error: Bootstrap's JavaScript requires at least jQuery v1.9.1 but less than v3.0.0

@XhmikosR
Copy link
Member

Because it's not yet merged let alone released?

@TheBuzzer67
Copy link

Even if I use the dev version?

@XhmikosR
Copy link
Member

Nope. See #20191.

cvrebert pushed a commit that referenced this issue Jun 28, 2016
…e done()s (#20198)

Fixes test flakiness on OS X Safari and Android when using jQuery 3.
Fixes #20182 more
Refs #20191
@cvrebert
Copy link
Collaborator Author

Fixed by #20198. Hopefully that's the last one.

cvrebert pushed a commit that referenced this issue Jul 8, 2016
Scrollspy test: Allow for async .then() in jQuery 3; fixes #20182

Instead of doing a new assert.async(), just do a single one for the entire test
and let the .then() be async as well.
cvrebert pushed a commit that referenced this issue Jul 8, 2016
ScrollSpy unit test: Use single done() in a then() instead of multiple done()s

Fixes test flakiness on OS X Safari and Android when using jQuery 3.
Fixes #20182 more
Refs #20191
chiraggmodi pushed a commit to chiraggmodi/bootstrap that referenced this issue Apr 8, 2019
Scrollspy test: Allow for async .then() in jQuery 3; fixes twbs#20182

Instead of doing a new assert.async(), just do a single one for the entire test
and let the .then() be async as well.
chiraggmodi pushed a commit to chiraggmodi/bootstrap that referenced this issue Apr 8, 2019
ScrollSpy unit test: Use single done() in a then() instead of multiple done()s

Fixes test flakiness on OS X Safari and Android when using jQuery 3.
Fixes twbs#20182 more
Refs twbs#20191
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants