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>
This commit is contained in:
Clément Drouin 2026-04-28 17:44:07 +02:00 committed by GitHub
parent a83c81ecf5
commit 632ea8c032
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
253 changed files with 13965 additions and 2525 deletions

View file

@ -4,7 +4,10 @@ from textual.app import App, ComposeResult
from textual.containers import Container
from textual.pilot import Pilot
from tests.cli.plan_offer.adapters.fake_whoami_gateway import FakeWhoAmIGateway
from tests.snapshots.base_snapshot_test_app import BaseSnapshotTestApp, default_config
from tests.snapshots.snap_compare import SnapCompare
from vibe.cli.plan_offer.ports.whoami_gateway import WhoAmIPlanType, WhoAmIResponse
from vibe.cli.textual_ui.widgets.question_app import QuestionApp
from vibe.cli.textual_ui.widgets.teleport_message import TeleportMessage
from vibe.core.tools.builtins.ask_user_question import (
@ -59,7 +62,7 @@ class TeleportMessageAuthCompleteApp(TeleportMessageTestApp):
class TeleportMessageStartingWorkflowApp(TeleportMessageTestApp):
def on_mount(self) -> None:
widget = self.query_one(TeleportMessage)
widget.set_status("Starting Nuage workflow...")
widget.set_status("Starting Vibe Code session...")
if widget._spinner_timer:
widget._spinner_timer.stop()
@ -120,6 +123,45 @@ class TeleportPushConfirmationMultipleCommitsApp(TeleportPushConfirmationTestApp
super().__init__(count=5)
def _teleport_snapshot_config():
return default_config().model_copy(update={"vibe_code_enabled": True})
class TeleportCommandHelpSnapshotApp(BaseSnapshotTestApp):
def __init__(self, gateway: FakeWhoAmIGateway):
super().__init__(config=_teleport_snapshot_config(), plan_offer_gateway=gateway)
async def on_mount(self) -> None:
await super().on_mount()
await self._show_help()
class TeleportCommandHelpProApp(TeleportCommandHelpSnapshotApp):
def __init__(self):
super().__init__(
FakeWhoAmIGateway(
WhoAmIResponse(
plan_type=WhoAmIPlanType.CHAT,
plan_name="INDIVIDUAL",
prompt_switching_to_pro_plan=False,
)
)
)
class TeleportCommandHelpFreeApp(TeleportCommandHelpSnapshotApp):
def __init__(self):
super().__init__(
FakeWhoAmIGateway(
WhoAmIResponse(
plan_type=WhoAmIPlanType.API,
plan_name="FREE",
prompt_switching_to_pro_plan=False,
)
)
)
def test_snapshot_teleport_status_checking_git(snap_compare: SnapCompare) -> None:
async def run_before(pilot: Pilot) -> None:
await pilot.pause(0.2)
@ -247,3 +289,29 @@ def test_snapshot_teleport_push_confirmation_cancel_selected(
terminal_size=(80, 12),
run_before=run_before,
)
def test_snapshot_teleport_command_visible_for_pro_account(
snap_compare: SnapCompare,
) -> None:
async def run_before(pilot: Pilot) -> None:
await pilot.pause(0.2)
assert snap_compare(
"test_ui_snapshot_teleport.py:TeleportCommandHelpProApp",
terminal_size=(120, 48),
run_before=run_before,
)
def test_snapshot_teleport_command_hidden_for_non_pro_account(
snap_compare: SnapCompare,
) -> None:
async def run_before(pilot: Pilot) -> None:
await pilot.pause(0.2)
assert snap_compare(
"test_ui_snapshot_teleport.py:TeleportCommandHelpFreeApp",
terminal_size=(120, 48),
run_before=run_before,
)