2026-05-30 02:22:15 +00:00
|
|
|
from pathlib import Path
|
|
|
|
|
|
|
|
|
|
ROOT = Path(__file__).resolve().parent.parent
|
|
|
|
|
UI_JS = (ROOT / "static" / "ui.js").read_text(encoding="utf-8")
|
|
|
|
|
STYLE_CSS = (ROOT / "static" / "style.css").read_text(encoding="utf-8")
|
|
|
|
|
|
|
|
|
|
|
2026-05-30 08:26:03 +00:00
|
|
|
def test_tool_cards_use_legacy_compact_header_without_tool_output_badge():
|
2026-06-20 21:48:55 +00:00
|
|
|
"""Tool cards keep the compact header without surfacing output as a badge."""
|
2026-05-30 02:22:15 +00:00
|
|
|
build_start = UI_JS.index('function buildToolCard(tc){')
|
|
|
|
|
build_end = UI_JS.index('function _syncToolCallGroupSummary', build_start)
|
|
|
|
|
build_tool_card = UI_JS[build_start:build_end]
|
|
|
|
|
|
2026-05-30 08:26:03 +00:00
|
|
|
assert 'tool-card-badge' not in build_tool_card
|
|
|
|
|
assert 'Tool output' not in build_tool_card
|
2026-06-20 21:48:55 +00:00
|
|
|
assert '<span class="tool-card-name-label">${esc(displayName)}</span>' in build_tool_card
|
|
|
|
|
assert '<span class="tool-card-name-generic">${esc(genericName)}</span>' in build_tool_card
|
2026-05-30 02:22:15 +00:00
|
|
|
|
|
|
|
|
|
2026-05-30 08:26:03 +00:00
|
|
|
def test_tool_card_badge_style_is_absent():
|
|
|
|
|
assert '.tool-card-badge{' not in STYLE_CSS
|
2026-05-30 02:22:15 +00:00
|
|
|
assert '.tool-card:hover .tool-card-badge' not in STYLE_CSS
|
|
|
|
|
|
|
|
|
|
|
2026-05-30 08:26:03 +00:00
|
|
|
def test_tool_cards_use_legacy_muted_rail():
|
2026-05-30 02:22:15 +00:00
|
|
|
assert '.tool-card{background:var(--surface-subtle);' in STYLE_CSS
|
2026-05-30 08:26:03 +00:00
|
|
|
assert 'border-left:2px solid var(--border-muted)' in STYLE_CSS
|
|
|
|
|
assert 'border-left:3px solid var(--accent-bg-strong)' not in STYLE_CSS
|