Skip to content

Commit

Permalink
Fix scrolling again in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kulmann committed Aug 13, 2020
1 parent 114f047 commit a51554b
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions tests/acceptance/pageObjects/FilesPageElement/filesList.js
Original file line number Diff line number Diff line change
Expand Up @@ -474,10 +474,6 @@ module.exports = {

// Check if the item is inside the view after it's renredered
if (position.top > -1 && position.top <= visiblePosition) {
// Scroll item to the top of the list
scrollDistance += position.top - tableHeaderPosition
virtualScrollWrapper.scrollTop = scrollDistance

done()
return
}
Expand All @@ -488,8 +484,9 @@ module.exports = {
return
}

// we assume that we'll always have enough screen height for showing 5 list items at once,
// thus, scrolling by 5 items at a time and checking again if the item is now visible.
const listItemHeight = document.querySelector(listItemSelector).clientHeight

scrollDistance += listItemHeight * 5
virtualScrollWrapper.scrollTop = scrollDistance
setTimeout(function() {
Expand Down

0 comments on commit a51554b

Please sign in to comment.