Add test to ensure that scroll position is kept when opening/closing source sidebar

This commit is contained in:
Guillaume Gomez 2022-06-29 23:21:46 +02:00
parent 72f6322f8a
commit 9a1f52d7fd

View File

@ -138,3 +138,17 @@ assert-css: (
"border-bottom-width": "1px",
},
)
// We now check that the scroll position is kept when opening the sidebar.
click: "#sidebar-toggle"
wait-for-css: (".sidebar", {"width": "0px"})
// We scroll to line 117 to change the scroll position.
scroll-to: '//*[@id="117"]'
assert-window-property: {"pageYOffset": "2519"}
// Expanding the sidebar...
click: "#sidebar-toggle"
wait-for-css: (".sidebar", {"width": "500px"})
click: "#sidebar-toggle"
wait-for-css: (".sidebar", {"width": "0px"})
// The "scrollTop" property should be the same.
assert-window-property: {"pageYOffset": "2519"}