diff --git a/src/virtual_dom/vtag.rs b/src/virtual_dom/vtag.rs index 713be2ea0c7..51c7b86b4dc 100644 --- a/src/virtual_dom/vtag.rs +++ b/src/virtual_dom/vtag.rs @@ -977,7 +977,11 @@ mod tests { #[test] fn swap_order_of_classes() { let parent = document().create_element("div").unwrap(); + + #[cfg(feature = "std_web")] document().body().unwrap().append_child(&parent); + #[cfg(feature = "web_sys")] + document().body().unwrap().append_child(&parent).unwrap(); let mut elem = html! {
}; elem.apply(&parent, None, None); @@ -1023,7 +1027,11 @@ mod tests { #[test] fn add_class_to_the_middle() { let parent = document().create_element("div").unwrap(); + + #[cfg(feature = "std_web")] document().body().unwrap().append_child(&parent); + #[cfg(feature = "web_sys")] + document().body().unwrap().append_child(&parent).unwrap(); let mut elem = html! { }; elem.apply(&parent, None, None);