dioxus/packages/core/tests/boolattrs.rs

23 lines
617 B
Rust
Raw Normal View History

2022-12-09 22:18:37 +00:00
use bumpalo::Bump;
2022-11-24 11:47:14 +00:00
use dioxus::core::{ElementId, Mutation::*};
use dioxus::prelude::*;
#[test]
fn bool_test() {
let mut app = VirtualDom::new(|cx| cx.render(rsx!(div { hidden: false })));
2022-12-09 22:18:37 +00:00
let bump = Bump::new();
2022-11-24 11:47:14 +00:00
assert_eq!(
2022-12-01 05:46:15 +00:00
app.rebuild().santize().edits,
2022-11-24 11:47:14 +00:00
[
LoadTemplate { name: "template", index: 0, id: ElementId(1) },
2022-12-09 22:18:37 +00:00
SetAttribute {
name: "hidden",
value: false.into_value(&bump),
id: ElementId(1,),
ns: None
},
2022-12-03 00:24:49 +00:00
AppendChildren { m: 1, id: ElementId(0) },
2022-11-24 11:47:14 +00:00
]
2022-12-09 22:18:37 +00:00
);
2022-11-24 11:47:14 +00:00
}