Co-authored-by: Clément Sirieix <clement.sirieix@mistral.ai> Co-authored-by: Guillaume LE GOFF <guillaume.lgf@gmail.com> Co-authored-by: Hdandria <henri.dandria@mistral.ai> Co-authored-by: Ivana Dunisijevic <ivana.dunisijevic@mistral.ai> Co-authored-by: Jean Burellier <sheplu@users.noreply.github.com> Co-authored-by: Mathias Gesbert <mathias.gesbert@mistral.ai> Co-authored-by: Mert Unsal <mert.unsal@mistral.ai> Co-authored-by: Michel Thomazo <51709227+michelTho@users.noreply.github.com> Co-authored-by: Paul VEZIA <166131032+le-codeur-rapide@users.noreply.github.com> Co-authored-by: Pierre Rossinès <pierre.rossines@mistral.ai> Co-authored-by: Val <102326092+vdeva@users.noreply.github.com> Co-authored-by: Vincent G <10739306+VinceOPS@users.noreply.github.com> Co-authored-by: renovate-mistral[bot] <253709520+renovate-mistral[bot]@users.noreply.github.com> Co-authored-by: Mistral Vibe <vibe@mistral.ai>
48 lines
1.4 KiB
Python
48 lines
1.4 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
|
|
from vibe.cli.textual_ui.widgets.session_picker import SessionPickerApp
|
|
from vibe.core.session.resume_sessions import ResumeSessionInfo
|
|
|
|
_SESSIONS = [
|
|
ResumeSessionInfo(
|
|
session_id="local-session-0001",
|
|
cwd="/test/workdir",
|
|
title="Refactor the auth module",
|
|
end_time=None,
|
|
),
|
|
ResumeSessionInfo(
|
|
session_id="local-session-0002",
|
|
cwd="/test/workdir",
|
|
title="Add unit tests for the API",
|
|
end_time=None,
|
|
),
|
|
]
|
|
|
|
_LATEST_MESSAGES = {
|
|
_SESSIONS[0].option_id: "Refactor the auth module",
|
|
_SESSIONS[1].option_id: "Add unit tests for the API",
|
|
}
|
|
|
|
|
|
class SessionPickerTestApp(BaseSnapshotTestApp):
|
|
async def on_mount(self) -> None:
|
|
await super().on_mount()
|
|
picker = SessionPickerApp(
|
|
sessions=_SESSIONS, latest_messages=_LATEST_MESSAGES, cwd="/test/workdir"
|
|
)
|
|
await self._switch_from_input(picker)
|
|
|
|
|
|
def test_snapshot_session_picker_header(snap_compare: SnapCompare) -> None:
|
|
async def run_before(pilot: Pilot) -> None:
|
|
await pilot.pause(0.2)
|
|
|
|
assert snap_compare(
|
|
"test_ui_snapshot_session_picker.py:SessionPickerTestApp",
|
|
terminal_size=(100, 36),
|
|
run_before=run_before,
|
|
)
|