Skip to content

Commit

Permalink
test and snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
willmcgugan committed Aug 21, 2024
1 parent 65d35c1 commit 1ed1dca
Show file tree
Hide file tree
Showing 3 changed files with 161 additions and 2 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion tests/snapshot_tests/snapshot_apps/scroll_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
class RichLogTest(App):
def compose(self):
ri = RichLog(auto_scroll=False)
suffix = os.environ.get("SUFFIX", "A" * 1000)
suffix = "A" * 1000
for i in range(1, 1000):
ri.write(f"This is line number {i} {suffix}")
yield ri
Expand Down
5 changes: 4 additions & 1 deletion tests/snapshot_tests/test_snapshots.py
Original file line number Diff line number Diff line change
Expand Up @@ -1452,4 +1452,7 @@ def test_split(snap_compare):

def test_scroll_page_down(snap_compare):
"""Regression test for https://github.com/Textualize/textual/issues/4914"""
assert snap_compare(SNAPSHOT_APPS_DIR / "scroll_page.py", press=["pagedown"])
# Should show 25 at the top
assert snap_compare(
SNAPSHOT_APPS_DIR / "scroll_page.py", press=["pagedown"], terminal_size=(80, 25)
)

0 comments on commit 1ed1dca

Please sign in to comment.