Skip to content

Commit

Permalink
refactor(e2e): clean up scroll-behavior tests (#3200)
Browse files Browse the repository at this point in the history

Co-authored-by: Eduardo San Martin Morote <posva@users.noreply.github.com>
  • Loading branch information
Calvin-LL and posva committed May 16, 2020
1 parent dcb7f7e commit 00c39f0
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions test/e2e/specs/scroll-behavior.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,8 @@ module.exports = {
null,
'restore scroll position on back'
)

// with manual scroll restoration
// https://developers.google.com/web/updates/2015/09/history-api-scroll-restoration
.execute(function () {
window.scrollTo(0, 100)
history.scrollRestoration = 'manual'
})
.click('li:nth-child(2) a')
.waitForElementPresent('.view.foo', TIMEOUT)
Expand Down Expand Up @@ -107,19 +103,15 @@ module.exports = {
'scroll to anchor'
)

.execute(function () {
document.querySelector('li:nth-child(5) a').click()
})
.click('li:nth-child(5) a')
.assert.evaluate(
function () {
return document.getElementById('anchor2').getBoundingClientRect().top < 101
},
null,
'scroll to anchor with offset'
)
.execute(function () {
document.querySelector('li:nth-child(6) a').click()
})
.click('li:nth-child(6) a')
.assert.evaluate(
function () {
return document.getElementById('1number').getBoundingClientRect().top < 1
Expand Down

0 comments on commit 00c39f0

Please sign in to comment.