MCPcopy
hub / github.com/reflex-dev/reflex / test_add_style_create

Function test_add_style_create

tests/units/components/test_component.py:472–486  ·  view source on GitHub ↗

Test that adding style works with the create method. Args: component1: A test component. component2: A test component.

(component1, component2)

Source from the content-addressed store, hash-verified

470
471
472def test_add_style_create(component1, component2):
473 """Test that adding style works with the create method.
474
475 Args:
476 component1: A test component.
477 component2: A test component.
478 """
479 style = {
480 component1.create: Style({"color": "white"}),
481 component2.create: Style({"color": "black"}),
482 }
483 c1 = component1.create()._add_style_recursive(style)
484 c2 = component2.create()._add_style_recursive(style)
485 assert str(c1.style["color"]) == '"white"'
486 assert str(c2.style["color"]) == '"black"'
487
488
489def test_get_imports(component1, component2):

Callers

nothing calls this directly

Calls 3

StyleClass · 0.90
_add_style_recursiveMethod · 0.45
createMethod · 0.45

Tested by

no test coverage detected