TimelinePanel-test: Hackery to make it pass

pull/21833/head
Richard van der Hoff 2016-08-24 17:30:53 +01:00
parent cdd2902b01
commit 6bcf9cc9db
1 changed files with 6 additions and 5 deletions

View File

@ -296,11 +296,12 @@ describe('TimelinePanel', function() {
// direction.
setScrollTop(scrollingDiv.scrollHeight);
scrollingDiv.scrollTop = scrollingDiv.scrollHeight;
return awaitScroll();
}).then(() => {
expect(messagePanel.props.backPaginating).toBe(false);
expect(messagePanel.props.forwardPaginating).toBe(true);
return awaitScroll();
// the delay() below is a heinous hack to deal with the fact that,
// without it, we may or may not get control back before the
// forward pagination completes. The delay means that it should
// have completed.
return awaitScroll().delay(0);
}).then(() => {
expect(messagePanel.props.backPaginating).toBe(false);
expect(messagePanel.props.forwardPaginating).toBe(false);