use dioxus::prelude::*; #[test] fn static_styles() { fn app() -> Element { render! { div { width: "100px" } } } let mut dom = VirtualDom::new(app); _ = dom.rebuild(&mut dioxus_core::NoOpMutations); assert_eq!( dioxus_ssr::render(&dom), r#"
"# ); } #[test] fn partially_dynamic_styles() { let dynamic = 123; assert_eq!( dioxus_ssr::render_element(render! { div { width: "100px", height: "{dynamic}px" } }), r#"
"# ); } #[test] fn dynamic_styles() { let dynamic = 123; assert_eq!( dioxus_ssr::render_element(render! { div { width: "{dynamic}px" } }), r#"
"# ); }