can we have one or 2 unit tests to check this works as expected ?

you can have a look to fixed_header_test to see how you can test scroll events stuff. In particular, as soon as you change scrollTop, you'll get a scroll event., so you don't need to call manageScroll directly.