From 6bcf9cc9db20c21f5ac31f7f6f76a4d441f89c68 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Wed, 24 Aug 2016 17:30:53 +0100 Subject: [PATCH] TimelinePanel-test: Hackery to make it pass --- test/components/structures/TimelinePanel-test.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/test/components/structures/TimelinePanel-test.js b/test/components/structures/TimelinePanel-test.js index fb82404616..e817923ec7 100644 --- a/test/components/structures/TimelinePanel-test.js +++ b/test/components/structures/TimelinePanel-test.js @@ -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);