def test_validate_cond(cond_state: BaseState):
    """Test if cond can be a rx.Var with any values.

    Args:
        cond_state: A fixture.
    """
    cond_component = cond(
        cond_state.value,
        Text.create("cond is True"),
        Text.create("cond is False"),
    )
    cond_dict = cond_component.render() if type(cond_component) is Fragment else {}
    assert cond_dict["name"] == "Fragment"

    [condition] = cond_dict["children"]
    assert condition["cond_state"] == str(cond_state.value.bool())

    # true value
    true_value = condition["true_value"]
    assert true_value["name"] == "Fragment"

    [true_value_text] = true_value["children"]
    assert true_value_text["name"] == "RadixThemesText"
    assert true_value_text["children"][0]["contents"] == '"cond is True"'

    # false value
    false_value = condition["false_value"]
    assert false_value["name"] == "Fragment"

    [false_value_text] = false_value["children"]
    assert false_value_text["name"] == "RadixThemesText"
    assert false_value_text["children"][0]["contents"] == '"cond is False"'
Test if cond can be a rx.Var with any values.

    Args:
        cond_state: A fixture.
    
tests/units/components/core/test_cond.py