Files
hermes-webui/tests/test_provider_cost_chart_ui.py
nesquena-hermes 1d5c054815 Release v0.51.323 — Release KM (7-day provider spend chart, #3600) (#3804)
#3600 (@rodboev): 7-day spend chart + monthly pace in the provider quota card. UX-approved by Nathan. Full suite 8235, Codex SAFE (backend contract verified), Opus SHIP + refresh-keeps-chart fix (live-verified). CI 11/11. Co-authored-by: rodboev <rodboev@users.noreply.github.com>
2026-06-07 17:41:59 -07:00

31 lines
989 B
Python

from __future__ import annotations
from pathlib import Path
REPO_ROOT = Path(__file__).resolve().parents[1]
def test_provider_cost_chart_ui_guards_are_present():
panels_js = (REPO_ROOT / "static" / "panels.js").read_text(encoding="utf-8")
style_css = (REPO_ROOT / "static" / "style.css").read_text(encoding="utf-8")
# function is defined
assert "async function renderProviderCostChart(card)" in panels_js
# function is wired up inside loadProvidersPanel (fire-and-forget)
assert "renderProviderCostChart(quotaCard)" in panels_js
# fetch target is correct
assert "/api/provider/cost-history?provider=openrouter" in panels_js
# CSS container class present in both JS and CSS
assert "provider-cost-chart-wrap" in panels_js
assert "provider-cost-chart-wrap" in style_css
# monthly pace projection annotation
assert "Monthly pace" in panels_js
# null delta guard for the oldest snapshot
assert "s.delta!=null" in panels_js