use node_html_parser::{parse_with_options, Options};
#[test]
fn issue_145_angular_like_attributes() {
let html = "<input matInput (keyup)=\"applyFilter($event)\" placeholder=\"Ex. IMEI\" #input>";
let root = parse_with_options(html, &Options::default());
let input = root.first_element_child().expect("input element");
let mut cloned = input.clone();
assert_eq!(cloned.get_attribute("#input").as_deref(), Some(""));
assert_eq!(
cloned.get_attribute("(keyup)").as_deref(),
Some("applyFilter($event)")
);
assert_eq!(
cloned.get_attribute("placeholder").as_deref(),
Some("Ex. IMEI")
);
let s = input.to_string();
assert!(
s == html || s == format!("{}", html.replace(">", "/>")),
"unexpected serialization: {}",
s
);
}