vibe/tests/snapshots/test_ui_snapshot_config_issues.py
Mathias Gesbert 3f8487f761
v2.14.0 (#743)
Co-authored-by: Alexis Tacnet <alexis@mistral.ai>
Co-authored-by: Clément Drouin <clement.drouin@mistral.ai>
Co-authored-by: Guillaume LE GOFF <guillaume.lgf@gmail.com>
Co-authored-by: Lucas Marandat <31749711+lucasmrdt@users.noreply.github.com>
Co-authored-by: Maxime Dolores <maxime.dolores@ext.mistral.ai>
Co-authored-by: Pierre Rossinès <pierre.rossines@mistral.ai>
Co-authored-by: Quentin <quentin.torroba@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: p.vezia <166131032+le-codeur-rapide@users.noreply.github.com>
Co-authored-by: Hiba Chaabnia <Hiba-Chaabnia@users.noreply.github.com>
Co-authored-by: Nikhil Bhima <nikhilbhima@users.noreply.github.com>
Co-authored-by: Nkipohcs <Nkipohcs@users.noreply.github.com>
Co-authored-by: Mistral Vibe <vibe@mistral.ai>
2026-06-04 18:26:35 +02:00

56 lines
1.7 KiB
Python

from __future__ import annotations
from pathlib import Path
from textual.pilot import Pilot
from tests.snapshots.base_snapshot_test_app import BaseSnapshotTestApp
from tests.snapshots.snap_compare import SnapCompare
from vibe.core.hooks.models import HookConfigIssue
from vibe.core.skills.models import SkillConfigIssue
class SnapshotTestAppWithConfigIssues(BaseSnapshotTestApp):
def __init__(self) -> None:
super().__init__()
self.agent_loop.skill_manager._config_issues = [
SkillConfigIssue(
file=Path("/test/skills/broken-skill/SKILL.md"),
message="Failed to load: missing required field 'description'",
)
]
class SnapshotTestAppWithHookConfigIssue(BaseSnapshotTestApp):
def __init__(self) -> None:
super().__init__()
self.agent_loop.hook_config_issues = [
HookConfigIssue(
file=Path("/test/hooks/broken-hook.toml"),
message="Failed to parse: invalid TOML syntax",
)
]
def test_snapshot_shows_config_issue_notification(snap_compare: SnapCompare) -> None:
async def run_before(pilot: Pilot) -> None:
await pilot.pause(0.3)
assert snap_compare(
"test_ui_snapshot_config_issues.py:SnapshotTestAppWithConfigIssues",
terminal_size=(120, 36),
run_before=run_before,
)
def test_snapshot_shows_hook_config_issue_notification(
snap_compare: SnapCompare,
) -> None:
async def run_before(pilot: Pilot) -> None:
await pilot.pause(0.3)
assert snap_compare(
"test_ui_snapshot_config_issues.py:SnapshotTestAppWithHookConfigIssue",
terminal_size=(120, 36),
run_before=run_before,
)