mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Snapshot tests for the CLI preview apps (#1969)
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -9,6 +9,7 @@ WIDGET_EXAMPLES_DIR = Path("../../docs/examples/widgets")
|
|||||||
LAYOUT_EXAMPLES_DIR = Path("../../docs/examples/guide/layout")
|
LAYOUT_EXAMPLES_DIR = Path("../../docs/examples/guide/layout")
|
||||||
STYLES_EXAMPLES_DIR = Path("../../docs/examples/styles")
|
STYLES_EXAMPLES_DIR = Path("../../docs/examples/styles")
|
||||||
SNAPSHOT_APPS_DIR = Path("./snapshot_apps")
|
SNAPSHOT_APPS_DIR = Path("./snapshot_apps")
|
||||||
|
CLI_PREVIEWS_DIR = Path("../../src/textual/cli/previews")
|
||||||
|
|
||||||
|
|
||||||
# --- Layout related stuff ---
|
# --- 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 ---
|
# --- Other ---
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user