def test_cond_computed_var():
    """Test if cond works with computed vars."""

    class CondStateComputed(BaseState):
        @computed_var
        def computed_int(self) -> int:
            return 0

        @computed_var
        def computed_str(self) -> str:
            return "a string"

    comp = cond(True, CondStateComputed.computed_int, CondStateComputed.computed_str)

    # TODO: shouldn't this be a ComputedVar?
    assert isinstance(comp, Var)

    state_name = format_state_name(CondStateComputed.get_full_name())
    assert (
        str(comp) == f"(true ? {state_name}.computed_int : {state_name}.computed_str)"
    )

    assert comp._var_type == int | str
Test if cond works with computed vars.
tests/units/components/core/test_cond.py