Implement scroll_to_center method.

This commit is contained in:
Rodrigo Girão Serrão
2023-04-11 13:32:09 +01:00
parent e87edd79cb
commit 454254fab4
3 changed files with 111 additions and 0 deletions

View File

@@ -409,4 +409,10 @@ def test_scroll_visible(snap_compare):
def test_scroll_to_center(snap_compare):
# READ THIS IF THIS TEST FAILS:
# While https://github.com/Textualize/textual/issues/2254 is open, the snapshot
# this is being compared against is INCORRECT.
# The correct output for this snapshot test would show a couple of containers
# scrolled so that the red string >>bullseye<< is centered on the screen.
# When this snapshot "breaks" because #2254 is fixed, this snapshot can be updated.
assert snap_compare(SNAPSHOT_APPS_DIR / "scroll_to_center.py", press=["s"])