vibe/tests/snapshots/test_ui_snapshot_config_app.py
Clément Drouin 632ea8c032
v2.9.0 (#641)
Co-authored-by: Antoine <33425718+anth2o@users.noreply.github.com>
Co-authored-by: Bastien <bastien.baret@gmail.com>
Co-authored-by: Clément Sirieix <clement.sirieix@mistral.ai>
Co-authored-by: Kim-Adeline Miguel <51720070+kimadeline@users.noreply.github.com>
Co-authored-by: Mathias Gesbert <mathias.gesbert@mistral.ai>
Co-authored-by: Maxime Dolores <maxime.dolores@ext.mistral.ai>
Co-authored-by: Michel Thomazo <51709227+michelTho@users.noreply.github.com>
Co-authored-by: Nelson PROIA <144663685+Nelson-PROIA@users.noreply.github.com>
Co-authored-by: Pierre Rossinès <pierre.rossines@mistral.ai>
Co-authored-by: Quentin <quentin.torroba@mistral.ai>
Co-authored-by: Robin Gullo <robin.gullo@mistral.ai>
Co-authored-by: Mistral Vibe <vibe@mistral.ai>
2026-04-28 17:44:07 +02:00

64 lines
1.8 KiB
Python

from __future__ import annotations
from textual.pilot import Pilot
from tests.snapshots.base_snapshot_test_app import BaseSnapshotTestApp
from tests.snapshots.snap_compare import SnapCompare
class ConfigTestApp(BaseSnapshotTestApp):
async def on_mount(self) -> None:
await super().on_mount()
await self._switch_to_config_app()
def test_snapshot_config_initial(snap_compare: SnapCompare) -> None:
async def run_before(pilot: Pilot) -> None:
await pilot.pause(0.2)
assert snap_compare(
"test_ui_snapshot_config_app.py:ConfigTestApp",
terminal_size=(100, 36),
run_before=run_before,
)
def test_snapshot_config_navigate_down(snap_compare: SnapCompare) -> None:
async def run_before(pilot: Pilot) -> None:
await pilot.pause(0.2)
await pilot.press("down")
await pilot.pause(0.1)
assert snap_compare(
"test_ui_snapshot_config_app.py:ConfigTestApp",
terminal_size=(100, 36),
run_before=run_before,
)
def test_snapshot_config_toggle_autocopy(snap_compare: SnapCompare) -> None:
async def run_before(pilot: Pilot) -> None:
await pilot.pause(0.2)
await pilot.press("down")
await pilot.press("down")
await pilot.press("enter")
await pilot.pause(0.1)
assert snap_compare(
"test_ui_snapshot_config_app.py:ConfigTestApp",
terminal_size=(100, 36),
run_before=run_before,
)
def test_snapshot_config_escape_closes(snap_compare: SnapCompare) -> None:
async def run_before(pilot: Pilot) -> None:
await pilot.pause(0.2)
await pilot.press("escape")
await pilot.pause(0.2)
assert snap_compare(
"test_ui_snapshot_config_app.py:ConfigTestApp",
terminal_size=(100, 36),
run_before=run_before,
)