Skip to content

Commit 00c39f0

Browse files
Calvin-LLposva
andauthored
refactor(e2e): clean up scroll-behavior tests (#3200)
Co-authored-by: Eduardo San Martin Morote <[email protected]>
1 parent dcb7f7e commit 00c39f0

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

test/e2e/specs/scroll-behavior.js

+2-10
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,8 @@ module.exports = {
3333
null,
3434
'restore scroll position on back'
3535
)
36-
37-
// with manual scroll restoration
38-
// https://developers.google.com/web/updates/2015/09/history-api-scroll-restoration
3936
.execute(function () {
4037
window.scrollTo(0, 100)
41-
history.scrollRestoration = 'manual'
4238
})
4339
.click('li:nth-child(2) a')
4440
.waitForElementPresent('.view.foo', TIMEOUT)
@@ -107,19 +103,15 @@ module.exports = {
107103
'scroll to anchor'
108104
)
109105

110-
.execute(function () {
111-
document.querySelector('li:nth-child(5) a').click()
112-
})
106+
.click('li:nth-child(5) a')
113107
.assert.evaluate(
114108
function () {
115109
return document.getElementById('anchor2').getBoundingClientRect().top < 101
116110
},
117111
null,
118112
'scroll to anchor with offset'
119113
)
120-
.execute(function () {
121-
document.querySelector('li:nth-child(6) a').click()
122-
})
114+
.click('li:nth-child(6) a')
123115
.assert.evaluate(
124116
function () {
125117
return document.getElementById('1number').getBoundingClientRect().top < 1

0 commit comments

Comments
 (0)