From ef2281cceb80d91d47bc4bca6e766db8a375ab4b Mon Sep 17 00:00:00 2001 From: Will McGugan Date: Wed, 11 Sep 2024 15:53:01 +0100 Subject: [PATCH] snapshot --- .../test_snapshots/test_app_focus_style.svg | 152 ++++++++++++++++++ tests/snapshot_tests/test_snapshots.py | 12 +- 2 files changed, 160 insertions(+), 4 deletions(-) create mode 100644 tests/snapshot_tests/__snapshots__/test_snapshots/test_app_focus_style.svg diff --git a/tests/snapshot_tests/__snapshots__/test_snapshots/test_app_focus_style.svg b/tests/snapshot_tests/__snapshots__/test_snapshots/test_app_focus_style.svg new file mode 100644 index 0000000000..79cdfbd91a --- /dev/null +++ b/tests/snapshot_tests/__snapshots__/test_snapshots/test_app_focus_style.svg @@ -0,0 +1,152 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + FocusApp + + + + + + + + + + +┌───────────┐ + +BLURRED + +└───────────┘ + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/snapshot_tests/test_snapshots.py b/tests/snapshot_tests/test_snapshots.py index dea18c8423..bec3ce2b6b 100644 --- a/tests/snapshot_tests/test_snapshots.py +++ b/tests/snapshot_tests/test_snapshots.py @@ -122,7 +122,9 @@ async def run_before(pilot): pilot.app.query(Input).first().cursor_blink = False assert snap_compare( - SNAPSHOT_APPS_DIR / "masked_input.py", press=["A","B","C","0","1","-","D","E"], run_before=run_before + SNAPSHOT_APPS_DIR / "masked_input.py", + press=["A", "B", "C", "0", "1", "-", "D", "E"], + run_before=run_before, ) @@ -1688,7 +1690,9 @@ def on_mount(self) -> None: assert snap_compare(TextAreaExample(), press=["ctrl+m", "escape"]) -async def test_app_focus_style(snap_compare): +def test_app_focus_style(snap_compare): + """Test that app blur style can be selected.""" + class FocusApp(App): CSS = """ Label { @@ -1700,13 +1704,13 @@ class FocusApp(App): App:focus { .blurred { visibility: hidden; - } + } } App:blur { .focussed { visibility: hidden; - } + } } """