2023-08-08 17:56:41 +00:00
|
|
|
use dioxus::prelude::*;
|
|
|
|
|
|
|
|
#[test]
|
2024-07-24 00:49:33 +00:00
|
|
|
fn static_boolean_attributes() {
|
2024-01-15 17:12:24 +00:00
|
|
|
fn app() -> Element {
|
2024-01-16 19:18:46 +00:00
|
|
|
rsx! {
|
2023-08-08 17:56:41 +00:00
|
|
|
div { hidden: "false" }
|
|
|
|
div { hidden: "true" }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
let mut dom = VirtualDom::new(app);
|
2024-02-05 07:03:52 +00:00
|
|
|
dom.rebuild(&mut dioxus_core::NoOpMutations);
|
2023-08-08 17:56:41 +00:00
|
|
|
|
|
|
|
assert_eq!(
|
|
|
|
dioxus_ssr::render(&dom),
|
|
|
|
r#"<div></div><div hidden="true"></div>"#
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
2024-07-24 00:49:33 +00:00
|
|
|
fn dynamic_boolean_attributes() {
|
2024-01-15 17:12:24 +00:00
|
|
|
fn app() -> Element {
|
2024-01-16 19:18:46 +00:00
|
|
|
rsx! {
|
2023-08-08 17:56:41 +00:00
|
|
|
div { hidden: false }
|
|
|
|
div { hidden: true }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
let mut dom = VirtualDom::new(app);
|
2024-02-05 07:03:52 +00:00
|
|
|
dom.rebuild(&mut dioxus_core::NoOpMutations);
|
2023-08-08 17:56:41 +00:00
|
|
|
|
|
|
|
assert_eq!(
|
|
|
|
dioxus_ssr::render(&dom),
|
|
|
|
r#"<div></div><div hidden=true></div>"#
|
|
|
|
);
|
|
|
|
}
|