Skip to content

World's first open-source, agentic video production system. 12 production pipelines, 100+ tools, 700+ agent skill and production-knowledge files. Turn your AI coding assistant into a full video production studio.

Add contract tests for chart text colour on dark themes

Troy O'Leary9767ff2fb922
diff --git a/tests/contracts/test_remotion_video_transition_contract.py b/tests/contracts/test_remotion_video_transition_contract.py
index 3d30934b..a3286717 100644
--- a/tests/contracts/test_remotion_video_transition_contract.py
+++ b/tests/contracts/test_remotion_video_transition_contract.py
@@ -26,3 +26,43 @@ def test_cinematic_fades_are_bounded_by_each_scene_duration() -> None:
assert "Math.round(scene.durationSeconds * fps)" in source
assert "durationInFrames - fadeOutFrames" in source
+
+
+def _jsx_block(source: str, component: str) -> str:
+ """Return the JSX element text for <Component ... /> in the source."""
+ start = source.index(f"<{component}")
+ end = source.index("/>", start)
+ return source[start:end]
+
+
+def test_chart_scenes_receive_the_theme_text_color() -> None:
+ """Charts default textColor to near-black (#1F2937).
+
+ If Explainer does not forward the theme's textColor, every chart title,
+ axis label, category label and value renders dark-on-dark and is invisible
+ on any dark theme.
+ """
+ source = (REPO_ROOT / "remotion-composer/src/Explainer.tsx").read_text(
+ encoding="utf-8"
+ )
+
+ for component in ("BarChart", "LineChart", "PieChart", "KPIGrid"):
+ assert "textColor={textColor}" in _jsx_block(source, component), (
+ f"{component} must receive the theme textColor, "
+ f"or its labels are invisible on dark themes"
+ )
+
+
+def test_comparison_card_surface_follows_the_theme() -> None:
+ """ComparisonCard hardcodes cardBackgroundColor to a light grey (#F3F4F6).
+
+ On a dark theme it receives the theme's light textColor, so without a
+ themed card surface the labels are light-on-light.
+ """
+ source = (REPO_ROOT / "remotion-composer/src/Explainer.tsx").read_text(
+ encoding="utf-8"
+ )
+ block = _jsx_block(source, "ComparisonCard")
+
+ assert "textColor={textColor}" in block
+ assert "cardBackgroundColor={cut.cardBackgroundColor || theme.surfaceColor}" in block