Testing API
render_to_tree
Convert a virtual element tree into JSON-friendly data.
By default, :class:streamtree.core.element.ComponentCall nodes are not
executed (no Streamlit context required). Set expand_components=True to
expand them; callers must wrap execution in :func:streamtree.core.context.render_context
and have an active Streamlit session (st.session_state) when components use state().
:class:streamtree.elements.layout.Routes nodes appear as metadata (default,
query_param, route_names) only; this helper does not call
:func:streamtree.routing.sync_route or embed the active child subtree—use
integration tests against Streamlit for routing behavior.
summarize_tree_kinds
Count kind values in nested dict/list structures from :func:render_to_tree.
Useful for lightweight assertions in tests and optional perf/debug summaries.