use sauron::*; use test_fixtures::simple_program; use wasm_bindgen_test::*; mod test_fixtures; #[test] fn simple() { let html: Node<()> = html::fragment([div([], []), span([], [])]); let expected = "
"; assert_eq!(html.render_to_string(), expected); } wasm_bindgen_test_configure!(run_in_browser); #[wasm_bindgen_test] fn test_on_client() { let mut simple_program = simple_program(); let input = node! {
{ some_view() }
}; // this is returning a fragement node fn some_view() -> Node<()> { node! {

"Header"

"Main content here."
} } let expected = input.render_to_string(); simple_program .update_dom_with_vdom(input) .expect("must update dom"); let container = sauron_core::dom::document() .get_element_by_id("container") .unwrap(); assert_eq!(container.outer_html(), expected); }