Bug: window scrolling
See original GitHub issueI would like to use testacular for testing a window-scroll-related utility.
There seems to a bug wherein I cannot get correct scrolling behaviour. Given this code:
chai.should()
describe("foo", function () {
it("bar", function () {
$('body').append('<div id="foo"></div>')
$('#foo').css('height', 3000)
dump(window.innerHeight)
window.innerHeight.should.equal(300)
window.scrollY.should.equal(0)
window.scrollTo(window.scrollX, 50)
window.scrollY.should.equal(50)
});
});
I get the unexpected error:
info (watcher): Changed file "/Users/jasonkuhrt/projects/components/scroll-over/test.js".
PhantomJS 1.7 DUMP: 300
PhantomJS 1.7 foo bar FAILED
expected 0 to equal 50
at /Users/jasonkuhrt/projects/components/scroll-over/node_modules/chai/chai.js:258
at assertEqual (/Users/jasonkuhrt/projects/components/scroll-over/node_modules/chai/chai.js:662)
at /Users/jasonkuhrt/projects/components/scroll-over/node_modules/chai/chai.js:2780
at /Users/jasonkuhrt/projects/components/scroll-over/test.js:15
PhantomJS 1.7: Executed 1 of 1 (1 FAILED) (0.031 secs / NaN secs)
The specific assertion failing is:
window.scrollY.should.equal(50)
I am able to make this test pass with mocha-phantomjs. What’s going on in this testacular context?
Issue Analytics
- State:
- Created 11 years ago
- Comments:18 (4 by maintainers)
Top Results From Across the Web
How to fix Windows 10 scrolling by itself - SoftwareKeep
Do you have a problem with "Windows 10 scrolling by itself." This is annoying. In this guide, we highlight steps you can follow...
Read more >Weird scrolling glitch - Microsoft Community
The PC keeps scrolling up by itself, but it is not in all programs (I notice it happens in microsoft store apps, the...
Read more >Windows 10 Keeps Scrolling Down Automatically - [SOLVED]
How To Solve If Windows 10 Keeps Scrolling Down Automatically? · FIX 1: Change Windows Settings For Your Mouse · FIX 2: Check...
Read more >FIX: Windows 10/11 Scrolling down on its own. - wintips.org
Method 1: Disable 'Scroll inactive windows when hovering over them' option. This problem has been reportedly resolved by changing the Mouse settings. 1....
Read more >Windows Scrolling On Its Own? Try These Fixes
Besides this, it could also be a Windows bug causing the automatic scroll. If the issue is due to the PC receiving a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Wrapping aroung window.setTimeout did the trick. thx 👍
Got it working 😄