use sauron::{
html::{attributes::*, *},
*,
};
#[test]
fn style_should_be_valid() {
let node1: Node<()> = node!(
);
let expected = r#""#;
let mut buffer = String::new();
node1.render(&mut buffer).expect("must have no error");
assert_eq!(expected, buffer);
}
#[test]
fn with_events() {
let result: Node<()> = node! {
Hello world
};
let expected = "Hello world
";
assert_eq!(expected, result.render_to_string());
}
#[test]
fn unquoted_text() {
let result: Node<()> = node! {
Hello world
};
let expected: Node<()> = div(vec![id("hello")], vec![text("Hello world")]);
assert_eq!(expected, result);
}
#[test]
fn quoted_text() {
let result: Node<()> = node! {
"Hello world"
};
let expected: Node<()> = div(vec![id("hello")], vec![text("Hello world")]);
assert_eq!(expected, result);
}
#[test]
fn must_correctly_create_self_closing_tag() {
let result: Node<()> = node! {
};
let expected = r#""#;
assert_eq!(expected, result.render_to_string());
}
#[test]
fn must_correctly_create_non_self_closing_tag() {
let result: Node<()> = node! {
};
let expected = r#""#;
assert_eq!(expected, result.render_to_string());
}
#[test]
fn must_correctly_create_tags_with_namespace() {
let result: Node<()> = node! {
};
let expected = r#""#;
assert_eq!(expected, result.render_to_string());
}