Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
remove test for #528 as we removed that fix
Browse files Browse the repository at this point in the history
  • Loading branch information
bwindels committed Feb 26, 2019
1 parent ba5f163 commit 4203079
Showing 1 changed file with 0 additions and 53 deletions.
53 changes: 0 additions & 53 deletions test/components/structures/ScrollPanel-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,57 +224,4 @@ describe('ScrollPanel', function() {
expect(scrollingDiv.scrollTop).toEqual(1950);
});
});

it('should not get stuck in #528 workaround', function(done) {
let events = [];
Promise.resolve().then(() => {
// initialise with a bunch of events
for (let i = 0; i < 40; i++) {
events.push(i);
}
tester.setTileKeys(events);
expect(tester.fillCounts.b).toEqual(1);
expect(tester.fillCounts.f).toEqual(2);
expect(scrollingDiv.scrollHeight).toEqual(6050); // 40*150 + 50
expect(scrollingDiv.scrollTop).toEqual(6050 - 600);

// try to scroll up, to a non-integer offset.
tester.scrollPanel().scrollToToken("30", -101/3);

expect(scrollingDiv.scrollTop).toEqual(4616); // 31*150 - 34

// wait for the scroll event to land
return tester.awaitScroll(); // fails
}).then(() => {
expect(tester.lastScrollEvent).toEqual(4616);

// Now one more event; this will make it reset the scroll, but
// because the delta will be less than 1, will not trigger a
// scroll event, this leaving recentEventScroll defined.
console.log("Adding event 50");
events.push(50);
tester.setTileKeys(events);

// wait for the scrollpanel to stop trying to paginate
}).then(() => {
// Now, simulate hitting "scroll to bottom".
events = [];
for (let i = 100; i < 120; i++) {
events.push(i);
}
tester.setTileKeys(events);
tester.scrollPanel().scrollToBottom();

// wait for the scroll event to land
return tester.awaitScroll(); // fails
}).then(() => {
expect(scrollingDiv.scrollTop).toEqual(20*150 + 50 - 600);

// simulate a user-initiated scroll on the div
scrollingDiv.scrollTop = 1200;
return tester.awaitScroll();
}).then(() => {
expect(scrollingDiv.scrollTop).toEqual(1200);
}).done(done);
});
});

0 comments on commit 4203079

Please sign in to comment.