使用QUnit如何测试window.scroll事件?在下面的代码中,我正在触发事件,但这(据我所知)放在事件队列中。下一行中的ok
断言是在调用事件回调之前执行的。如何测试这类事件?
test("should attach panel once window scrolled down past certain point", function() {
$(window).scrollTop(1110); // puts event in a queue I believe and next line is executed before this scroll event callback
ok(LozengesPanel.panel.hasClass("fixed"),"lozenges panel is sticky");
});