Files
Jonathan Kelley c29cef4ea3 move ScopeId methods to the runtime (#4723)
* move `ScopeId` methods to runtime methods

* cargo check unused

* wip...

* wip...

* fix consume context

* fix test

* guard hoisted

* fix doc comment
2025-10-04 01:55:52 -07:00

20 lines
485 B
Rust

//! Tests related to safety of the library.
use dioxus::prelude::*;
/// Ensure no issues with not calling rebuild_to_vec
#[test]
fn root_node_isnt_null() {
let dom = VirtualDom::new(|| rsx!("Hello world!"));
let scope = dom.base_scope();
// We haven't built the tree, so trying to get out the root node should fail
assert!(scope.try_root_node().is_none());
dom.in_runtime(|| {
// The height should be 0
assert_eq!(scope.height(), 0);
});
}