"""Tests for the unified-diff renderer."""

from __future__ import annotations

from clients.terminal.tui.renderers.diff import DiffRenderer
from clients.terminal.tui.themes import set_active_theme


def test_diff_renderer_accepts_and_highlights() -> None:
    set_active_theme("gnexus-dark")
    renderer = DiffRenderer()
    msg = {
        "type": "diff",
        "old_label": "a.py",
        "new_label": "b.py",
        "content": "--- a.py\n+++ b.py\n@@ -1,2 +1,2 @@\n-old\n+new\n unchanged\n",
    }
    assert renderer.accepts(msg)
    renderable = renderer.render(msg)
    text = str(renderable.renderable)
    assert "old" in text
    assert "new" in text