mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-11-14 00:17:17 +00:00
19 lines
493 B
Rust
19 lines
493 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!(ScopeId::ROOT.height(), 0);
|
|
});
|
|
}
|