dioxus/packages/core/tests/create_element.rs

33 lines
951 B
Rust
Raw Normal View History

2024-01-16 01:14:11 +00:00
// use dioxus::dioxus_core::Mutation::*;
2022-11-27 07:06:04 +00:00
use dioxus::prelude::*;
#[test]
fn multiroot() {
2024-01-11 18:40:36 +00:00
let mut dom = VirtualDom::new(|| {
2024-01-16 19:18:46 +00:00
rsx! {
2022-11-27 07:06:04 +00:00
div { "Hello a" }
div { "Hello b" }
div { "Hello c" }
2024-01-11 01:21:15 +00:00
}
2022-11-27 07:06:04 +00:00
});
2022-12-03 00:24:49 +00:00
// note: we dont test template edits anymore
2024-01-11 01:21:15 +00:00
let _templates = dom.rebuild_to_vec().santize().templates;
2022-12-03 00:24:49 +00:00
// assert_eq!(
2024-01-11 01:21:15 +00:00
// dom.rebuild_to_vec().santize().templates,
2022-12-03 00:24:49 +00:00
// [
// CreateElement { name: "div" },
// CreateStaticText { value: "Hello a" },
// AppendChildren { m: 1 },
// CreateElement { name: "div" },
// CreateStaticText { value: "Hello b" },
// AppendChildren { m: 1 },
// CreateElement { name: "div" },
// CreateStaticText { value: "Hello c" },
// AppendChildren { m: 1 },
// SaveTemplate { name: "template", m: 3 }
// ]
// )
2022-11-27 07:06:04 +00:00
}