Merge pull request #331 from Demonthos/diff-fix

fix: diff_lazynodes bug adding children
This commit is contained in:
Jon Kelley authored and GitHub committed 2022-04-04 12:15:31 -04:00
commit 09d193d999
2 files changed
+26

No files matched your search

+25
View File
@@ -730,3 +730,28 @@ fn remove_list_nokeyed() {
]
);
}
#[test]
fn add_nested_elements() {
let vdom = new_dom();
let (_create, change) = vdom.diff_lazynodes(
rsx! {
div{}
},
rsx! {
div{
div{}
}
},
);
assert_eq!(
change.edits,
[
PushRoot { root: 1 },
CreateElement { root: 2, tag: "div" },
AppendChildren { many: 1 },
]
);
}