fix issue with maxlines and textlog

This commit is contained in:
Will McGugan
2022-10-31 11:03:34 +00:00
parent 2e98c21343
commit 9b9d58f716
5 changed files with 211 additions and 3 deletions

View File

@@ -8,6 +8,7 @@ from textual.widgets import Input, Button
# --- Layout related stuff ---
def test_grid_layout_basic(snap_compare):
assert snap_compare("docs/examples/guide/layout/grid_layout1.py")
@@ -41,6 +42,7 @@ def test_dock_layout_sidebar(snap_compare):
# When adding a new widget, ideally we should also create a snapshot test
# from these examples which test rendering and simple interactions with it.
def test_checkboxes(snap_compare):
"""Tests checkboxes but also acts a regression test for using
width: auto in a Horizontal layout context."""
@@ -94,12 +96,18 @@ def test_header_render(snap_compare):
assert snap_compare("docs/examples/widgets/header.py")
def test_textlog_max_lines(snap_compare):
assert snap_compare("tests/snapshots/textlog_max_lines.py", press=list("abcde"))
# --- CSS properties ---
# We have a canonical example for each CSS property that is shown in their docs.
# If any of these change, something has likely broken, so snapshot each of them.
PATHS = [
str(PurePosixPath(path)) for path in Path("docs/examples/styles").iterdir() if path.suffix == ".py"
str(PurePosixPath(path))
for path in Path("docs/examples/styles").iterdir()
if path.suffix == ".py"
]