dioxus/packages/rsx-rosetta/tests/web-component.rs
Jonathan Kelley be99e29e5f
Fixes to autofmt, make it more aggressive (#2230)
* fix: fmt unterminated if, be more aggressive with line splits

* Fix: Handle long exprs in for/if statements
2024-04-03 15:27:36 -07:00

23 lines
436 B
Rust

use html_parser::Dom;
#[test]
fn web_components_translate() {
let html = r#"
<div>
<my-component></my-component>
</div>
"#
.trim();
let dom = Dom::parse(html).unwrap();
let body = rsx_rosetta::rsx_from_html(&dom);
let out = dioxus_autofmt::write_block_out(body).unwrap();
let expected = r#"
div {
my-component {}
}"#;
pretty_assertions::assert_eq!(&out, &expected);
}