def test_foreach_component_styles():
    """Test that the foreach component works with global component styles."""
    component = el.div(
        foreach(
            ForEachState.colors_list,
            display_color,
        )
    )
    component._add_style_recursive({box: {"color": "red"}})
    assert 'css:({ ["color"] : "red" })' in str(component)
Test that the foreach component works with global component styles.
tests/units/components/core/test_foreach.py