Co-Authored-By: Quentin Torroba <quentin.torroba@mistral.ai>
Co-Authored-By: Michel Thomazo <michel.thomazo@mistral.ai>
Co-Authored-By: Kracekumar <kracethekingmaker@gmail.com>
This commit is contained in:
Quentin 2025-12-14 00:54:42 +01:00 committed by Mathias Gesbert
parent 661588de0c
commit d8dbeeb31e
91 changed files with 4521 additions and 873 deletions

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Before After
Before After

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Before After
Before After

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 19 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 19 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 19 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 19 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 19 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Before After
Before After

View file

@ -37,7 +37,7 @@ class BaseSnapshotTestApp(VibeApp):
self.agent = Agent(
config,
auto_approve=self.auto_approve,
mode=self._current_agent_mode,
enable_streaming=self.enable_streaming,
backend=FakeBackend(),
)

View file

@ -24,7 +24,7 @@ class SnapshotTestAppWithConversation(BaseSnapshotTestApp):
super().__init__(config=config)
self.agent = Agent(
config,
auto_approve=self.auto_approve,
mode=self._current_agent_mode,
enable_streaming=self.enable_streaming,
backend=fake_backend,
)

View file

@ -0,0 +1,84 @@
from __future__ import annotations
from textual.pilot import Pilot
from tests.snapshots.snap_compare import SnapCompare
def test_snapshot_default_mode(snap_compare: SnapCompare) -> None:
"""Test that default mode is displayed correctly at startup."""
async def run_before(pilot: Pilot) -> None:
await pilot.pause(0.1)
assert snap_compare(
"base_snapshot_test_app.py:BaseSnapshotTestApp",
terminal_size=(120, 36),
run_before=run_before,
)
def test_snapshot_cycle_to_plan_mode(snap_compare: SnapCompare) -> None:
"""Test that shift+tab cycles from default to plan mode."""
async def run_before(pilot: Pilot) -> None:
await pilot.pause(0.1)
await pilot.press("shift+tab") # default -> plan
await pilot.pause(0.1)
assert snap_compare(
"base_snapshot_test_app.py:BaseSnapshotTestApp",
terminal_size=(120, 36),
run_before=run_before,
)
def test_snapshot_cycle_to_accept_edits_mode(snap_compare: SnapCompare) -> None:
"""Test that shift+tab cycles from plan to accept edits mode."""
async def run_before(pilot: Pilot) -> None:
await pilot.pause(0.1)
await pilot.press("shift+tab") # default -> plan
await pilot.press("shift+tab") # plan -> accept edits
await pilot.pause(0.1)
assert snap_compare(
"base_snapshot_test_app.py:BaseSnapshotTestApp",
terminal_size=(120, 36),
run_before=run_before,
)
def test_snapshot_cycle_to_auto_approve_mode(snap_compare: SnapCompare) -> None:
"""Test that shift+tab cycles to auto approve mode."""
async def run_before(pilot: Pilot) -> None:
await pilot.pause(0.1)
await pilot.press("shift+tab") # default -> plan
await pilot.press("shift+tab") # plan -> accept edits
await pilot.press("shift+tab") # accept edits -> auto approve
await pilot.pause(0.1)
assert snap_compare(
"base_snapshot_test_app.py:BaseSnapshotTestApp",
terminal_size=(120, 36),
run_before=run_before,
)
def test_snapshot_cycle_wraps_to_default(snap_compare: SnapCompare) -> None:
"""Test that shift+tab cycles back to default mode after auto approve."""
async def run_before(pilot: Pilot) -> None:
await pilot.pause(0.1)
await pilot.press("shift+tab") # default -> plan
await pilot.press("shift+tab") # plan -> accept edits
await pilot.press("shift+tab") # accept edits -> auto approve
await pilot.press("shift+tab") # auto approve -> default (wrap)
await pilot.pause(0.1)
assert snap_compare(
"base_snapshot_test_app.py:BaseSnapshotTestApp",
terminal_size=(120, 36),
run_before=run_before,
)