V10.437 harden sales chart rendering
All checks were successful
CD Pipeline / deploy (push) Successful in 1m6s
All checks were successful
CD Pipeline / deploy (push) Successful in 1m6s
This commit is contained in:
@@ -34,3 +34,22 @@ def test_growth_analysis_canvas_is_primary_and_fallback_is_opt_in():
|
||||
assert "renderHtmlChartFallbacks();" not in render_body
|
||||
assert "catch(error =>" in script
|
||||
assert "renderHtmlChartFallbacks();" in script.split("catch(error =>", 1)[1]
|
||||
|
||||
|
||||
def test_chart_theme_has_cdn_timeout_and_fallback_sources():
|
||||
script = (ROOT / "web/static/js" / "analysis-chart-theme.js").read_text(encoding="utf-8")
|
||||
|
||||
assert "CHART_LOAD_TIMEOUT_MS" in script
|
||||
assert "Chart.js 載入逾時" in script
|
||||
assert "cdn.jsdelivr.net/npm/chart.js@4.4.6" in script
|
||||
assert "unpkg.com/chart.js@4.4.6" in script
|
||||
assert "cdnjs.cloudflare.com/ajax/libs/Chart.js/4.4.6" in script
|
||||
|
||||
|
||||
def test_sales_chart_runtime_guard_rejects_axis_only_canvases():
|
||||
script = (ROOT / "scripts" / "check_sales_charts_runtime.js").read_text(encoding="utf-8")
|
||||
|
||||
assert "nonZeroPoints" in script
|
||||
assert "colorPixels" in script
|
||||
assert "has no colored chart marks" in script
|
||||
assert "has no non-zero dataset values" in script
|
||||
|
||||
Reference in New Issue
Block a user