Snapshot tests for the CLI preview apps (#1969)

This commit is contained in:
darrenburns
2023-03-07 16:42:21 +00:00
committed by GitHub
parent 4e2be18761
commit 4921a5cb43
2 changed files with 699 additions and 0 deletions

File diff suppressed because one or more lines are too long

View File

@@ -9,6 +9,7 @@ WIDGET_EXAMPLES_DIR = Path("../../docs/examples/widgets")
LAYOUT_EXAMPLES_DIR = Path("../../docs/examples/guide/layout")
STYLES_EXAMPLES_DIR = Path("../../docs/examples/styles")
SNAPSHOT_APPS_DIR = Path("./snapshot_apps")
CLI_PREVIEWS_DIR = Path("../../src/textual/cli/previews")
# --- Layout related stuff ---
@@ -219,6 +220,25 @@ def test_programmatic_scrollbar_gutter_change(snap_compare):
)
# --- CLI Preview Apps ---
# For our CLI previews e.g. `textual easing`, `textual colors` etc, we have snapshots
def test_borders_preview(snap_compare):
assert snap_compare(CLI_PREVIEWS_DIR / "borders.py", press=["tab", "enter"])
def test_colors_preview(snap_compare):
assert snap_compare(CLI_PREVIEWS_DIR / "colors.py")
def test_easing_preview(snap_compare):
assert snap_compare(CLI_PREVIEWS_DIR / "easing.py")
def test_keys_preview(snap_compare):
assert snap_compare(CLI_PREVIEWS_DIR / "keys.py", press=["a", "b"])
# --- Other ---