work on fixing some core tests
This commit is contained in:
1 parent
4a1a00b0f0
commit
55f76fede6
35 files changed
+422
-460
No files matched your search
@@ -8,12 +8,12 @@ fn test_borrowed_state() {
|
||||
let mut dom = VirtualDom::new(Parent);
|
||||
|
||||
assert_eq!(
|
||||
dom.rebuild().santize().edits,
|
||||
dom.rebuild_to_vec().santize().edits,
|
||||
[
|
||||
LoadTemplate { name: "template", index: 0, id: ElementId(1,) },
|
||||
LoadTemplate { name: "template", index: 0, id: ElementId(2,) },
|
||||
LoadTemplate { name: "template", index: 0, id: ElementId(3,) },
|
||||
HydrateText { path: &[0,], value: "Hello w1!", id: ElementId(4,) },
|
||||
HydrateText { path: &[0,], value: "Hello w1!".to_string(), id: ElementId(4,) },
|
||||
ReplacePlaceholder { path: &[1,], m: 1 },
|
||||
ReplacePlaceholder { path: &[0,], m: 1 },
|
||||
AppendChildren { m: 1, id: ElementId(0) },
|
||||
@@ -24,11 +24,9 @@ fn test_borrowed_state() {
|
||||
fn Parent(cx: Scope) -> Element {
|
||||
let w1 = cx.use_hook(|| String::from("w1"));
|
||||
|
||||
cx.render(rsx! {
|
||||
div {
|
||||
Child { name: w1 }
|
||||
}
|
||||
})
|
||||
render! {
|
||||
div { Child { name: w1 } }
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Props)]
|
||||
@@ -37,12 +35,12 @@ struct ChildProps<'a> {
|
||||
}
|
||||
|
||||
fn Child<'a>(cx: Scope<'a, ChildProps<'a>>) -> Element {
|
||||
cx.render(rsx! {
|
||||
render! {
|
||||
div {
|
||||
h1 { "it's nested" }
|
||||
Child2 { name: cx.props.name }
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Props)]
|
||||
@@ -51,5 +49,5 @@ struct Grandchild<'a> {
|
||||
}
|
||||
|
||||
fn Child2<'a>(cx: Scope<'a, Grandchild<'a>>) -> Element {
|
||||
cx.render(rsx!(div { "Hello {cx.props.name}!" }))
|
||||
render!( div { "Hello {cx.props.name}!" } )
|
||||
}
|
||||
Reference in new issue
Block a user