Co-authored-by: Clément Drouin <clement.drouin@mistral.ai> Co-authored-by: Clément Sirieix <clement.sirieix@mistral.ai> Co-authored-by: Guillaume LE GOFF <guillaume.lgf@gmail.com> Co-authored-by: Mathias Gesbert <mathias.gesbert@mistral.ai> Co-authored-by: Michel Thomazo <51709227+michelTho@users.noreply.github.com> Co-authored-by: Pierre Rossinès <pierre.rossines@mistral.ai> Co-authored-by: Vincent G <10739306+VinceOPS@users.noreply.github.com> Co-authored-by: Mistral Vibe <vibe@mistral.ai>
33 lines
1.1 KiB
Python
33 lines
1.1 KiB
Python
from __future__ import annotations
|
|
|
|
import pytest
|
|
from textual.pilot import Pilot
|
|
|
|
from tests.snapshots.snap_compare import SnapCompare
|
|
from vibe.setup.onboarding import OnboardingApp
|
|
from vibe.setup.onboarding.screens.theme_selection import ThemeSelectionScreen
|
|
|
|
|
|
async def _advance_to_theme_screen(pilot: Pilot) -> None:
|
|
welcome = pilot.app.get_screen("welcome")
|
|
for _ in range(40):
|
|
await pilot.pause(0.1)
|
|
if not welcome.query_one("#enter-hint").has_class("hidden"):
|
|
break
|
|
await pilot.press("enter")
|
|
for _ in range(20):
|
|
if isinstance(pilot.app.screen, ThemeSelectionScreen):
|
|
return
|
|
await pilot.pause(0.1)
|
|
|
|
|
|
@pytest.mark.parametrize("theme", ["ansi-dark", "ansi-light", "dracula"])
|
|
def test_snapshot_onboarding_theme_selection(
|
|
snap_compare: SnapCompare, theme: str
|
|
) -> None:
|
|
async def run_before(pilot: Pilot) -> None:
|
|
await _advance_to_theme_screen(pilot)
|
|
pilot.app.theme = theme
|
|
await pilot.pause(0.2)
|
|
|
|
assert snap_compare(OnboardingApp(), terminal_size=(80, 30), run_before=run_before)
|