|
@@ -18,7 +18,7 @@ fn list_creates_one_by_one() {
|
|
|
|
|
|
// load the div and then assign the empty fragment as a placeholder
|
|
// load the div and then assign the empty fragment as a placeholder
|
|
assert_eq!(
|
|
assert_eq!(
|
|
- dom.rebuild_to_vec().santize().edits,
|
|
|
|
|
|
+ dom.rebuild_to_vec().sanitize().edits,
|
|
[
|
|
[
|
|
LoadTemplate { name: "template", index: 0, id: ElementId(1,) },
|
|
LoadTemplate { name: "template", index: 0, id: ElementId(1,) },
|
|
AssignId { path: &[0], id: ElementId(2,) },
|
|
AssignId { path: &[0], id: ElementId(2,) },
|
|
@@ -29,7 +29,7 @@ fn list_creates_one_by_one() {
|
|
// Rendering the first item should replace the placeholder with an element
|
|
// Rendering the first item should replace the placeholder with an element
|
|
dom.mark_dirty(ScopeId::APP);
|
|
dom.mark_dirty(ScopeId::APP);
|
|
assert_eq!(
|
|
assert_eq!(
|
|
- dom.render_immediate_to_vec().santize().edits,
|
|
|
|
|
|
+ dom.render_immediate_to_vec().sanitize().edits,
|
|
[
|
|
[
|
|
LoadTemplate { name: "template", index: 0, id: ElementId(3,) },
|
|
LoadTemplate { name: "template", index: 0, id: ElementId(3,) },
|
|
HydrateText { path: &[0], value: "0".to_string(), id: ElementId(4,) },
|
|
HydrateText { path: &[0], value: "0".to_string(), id: ElementId(4,) },
|
|
@@ -40,7 +40,7 @@ fn list_creates_one_by_one() {
|
|
// Rendering the next item should insert after the previous
|
|
// Rendering the next item should insert after the previous
|
|
dom.mark_dirty(ScopeId::APP);
|
|
dom.mark_dirty(ScopeId::APP);
|
|
assert_eq!(
|
|
assert_eq!(
|
|
- dom.render_immediate_to_vec().santize().edits,
|
|
|
|
|
|
+ dom.render_immediate_to_vec().sanitize().edits,
|
|
[
|
|
[
|
|
LoadTemplate { name: "template", index: 0, id: ElementId(2,) },
|
|
LoadTemplate { name: "template", index: 0, id: ElementId(2,) },
|
|
HydrateText { path: &[0], value: "1".to_string(), id: ElementId(5,) },
|
|
HydrateText { path: &[0], value: "1".to_string(), id: ElementId(5,) },
|
|
@@ -51,7 +51,7 @@ fn list_creates_one_by_one() {
|
|
// ... and again!
|
|
// ... and again!
|
|
dom.mark_dirty(ScopeId::APP);
|
|
dom.mark_dirty(ScopeId::APP);
|
|
assert_eq!(
|
|
assert_eq!(
|
|
- dom.render_immediate_to_vec().santize().edits,
|
|
|
|
|
|
+ dom.render_immediate_to_vec().sanitize().edits,
|
|
[
|
|
[
|
|
LoadTemplate { name: "template", index: 0, id: ElementId(6,) },
|
|
LoadTemplate { name: "template", index: 0, id: ElementId(6,) },
|
|
HydrateText { path: &[0], value: "2".to_string(), id: ElementId(7,) },
|
|
HydrateText { path: &[0], value: "2".to_string(), id: ElementId(7,) },
|
|
@@ -62,7 +62,7 @@ fn list_creates_one_by_one() {
|
|
// once more
|
|
// once more
|
|
dom.mark_dirty(ScopeId::APP);
|
|
dom.mark_dirty(ScopeId::APP);
|
|
assert_eq!(
|
|
assert_eq!(
|
|
- dom.render_immediate_to_vec().santize().edits,
|
|
|
|
|
|
+ dom.render_immediate_to_vec().sanitize().edits,
|
|
[
|
|
[
|
|
LoadTemplate { name: "template", index: 0, id: ElementId(8,) },
|
|
LoadTemplate { name: "template", index: 0, id: ElementId(8,) },
|
|
HydrateText { path: &[0], value: "3".to_string(), id: ElementId(9,) },
|
|
HydrateText { path: &[0], value: "3".to_string(), id: ElementId(9,) },
|
|
@@ -87,7 +87,7 @@ fn removes_one_by_one() {
|
|
|
|
|
|
// load the div and then assign the empty fragment as a placeholder
|
|
// load the div and then assign the empty fragment as a placeholder
|
|
assert_eq!(
|
|
assert_eq!(
|
|
- dom.rebuild_to_vec().santize().edits,
|
|
|
|
|
|
+ dom.rebuild_to_vec().sanitize().edits,
|
|
[
|
|
[
|
|
// The container
|
|
// The container
|
|
LoadTemplate { name: "template", index: 0, id: ElementId(1) },
|
|
LoadTemplate { name: "template", index: 0, id: ElementId(1) },
|
|
@@ -109,14 +109,14 @@ fn removes_one_by_one() {
|
|
// Rendering the first item should replace the placeholder with an element
|
|
// Rendering the first item should replace the placeholder with an element
|
|
dom.mark_dirty(ScopeId::APP);
|
|
dom.mark_dirty(ScopeId::APP);
|
|
assert_eq!(
|
|
assert_eq!(
|
|
- dom.render_immediate_to_vec().santize().edits,
|
|
|
|
|
|
+ dom.render_immediate_to_vec().sanitize().edits,
|
|
[Remove { id: ElementId(6) }]
|
|
[Remove { id: ElementId(6) }]
|
|
);
|
|
);
|
|
|
|
|
|
// Remove div(2)
|
|
// Remove div(2)
|
|
dom.mark_dirty(ScopeId::APP);
|
|
dom.mark_dirty(ScopeId::APP);
|
|
assert_eq!(
|
|
assert_eq!(
|
|
- dom.render_immediate_to_vec().santize().edits,
|
|
|
|
|
|
+ dom.render_immediate_to_vec().sanitize().edits,
|
|
[Remove { id: ElementId(4) }]
|
|
[Remove { id: ElementId(4) }]
|
|
);
|
|
);
|
|
|
|
|
|
@@ -124,7 +124,7 @@ fn removes_one_by_one() {
|
|
// todo: this should just be a remove with no placeholder
|
|
// todo: this should just be a remove with no placeholder
|
|
dom.mark_dirty(ScopeId::APP);
|
|
dom.mark_dirty(ScopeId::APP);
|
|
assert_eq!(
|
|
assert_eq!(
|
|
- dom.render_immediate_to_vec().santize().edits,
|
|
|
|
|
|
+ dom.render_immediate_to_vec().sanitize().edits,
|
|
[
|
|
[
|
|
CreatePlaceholder { id: ElementId(4) },
|
|
CreatePlaceholder { id: ElementId(4) },
|
|
ReplaceWith { id: ElementId(2), m: 1 }
|
|
ReplaceWith { id: ElementId(2), m: 1 }
|
|
@@ -135,7 +135,7 @@ fn removes_one_by_one() {
|
|
// todo: this should actually be append to, but replace placeholder is fine for now
|
|
// todo: this should actually be append to, but replace placeholder is fine for now
|
|
dom.mark_dirty(ScopeId::APP);
|
|
dom.mark_dirty(ScopeId::APP);
|
|
assert_eq!(
|
|
assert_eq!(
|
|
- dom.render_immediate_to_vec().santize().edits,
|
|
|
|
|
|
+ dom.render_immediate_to_vec().sanitize().edits,
|
|
[
|
|
[
|
|
LoadTemplate { name: "template", index: 0, id: ElementId(2) },
|
|
LoadTemplate { name: "template", index: 0, id: ElementId(2) },
|
|
HydrateText { path: &[0], value: "0".to_string(), id: ElementId(6) },
|
|
HydrateText { path: &[0], value: "0".to_string(), id: ElementId(6) },
|
|
@@ -162,7 +162,7 @@ fn list_shrink_multiroot() {
|
|
});
|
|
});
|
|
|
|
|
|
assert_eq!(
|
|
assert_eq!(
|
|
- dom.rebuild_to_vec().santize().edits,
|
|
|
|
|
|
+ dom.rebuild_to_vec().sanitize().edits,
|
|
[
|
|
[
|
|
LoadTemplate { name: "template", index: 0, id: ElementId(1,) },
|
|
LoadTemplate { name: "template", index: 0, id: ElementId(1,) },
|
|
AssignId { path: &[0,], id: ElementId(2,) },
|
|
AssignId { path: &[0,], id: ElementId(2,) },
|
|
@@ -172,7 +172,7 @@ fn list_shrink_multiroot() {
|
|
|
|
|
|
dom.mark_dirty(ScopeId::APP);
|
|
dom.mark_dirty(ScopeId::APP);
|
|
assert_eq!(
|
|
assert_eq!(
|
|
- dom.render_immediate_to_vec().santize().edits,
|
|
|
|
|
|
+ dom.render_immediate_to_vec().sanitize().edits,
|
|
[
|
|
[
|
|
LoadTemplate { name: "template", index: 0, id: ElementId(3) },
|
|
LoadTemplate { name: "template", index: 0, id: ElementId(3) },
|
|
HydrateText { path: &[0], value: "0".to_string(), id: ElementId(4) },
|
|
HydrateText { path: &[0], value: "0".to_string(), id: ElementId(4) },
|
|
@@ -184,7 +184,7 @@ fn list_shrink_multiroot() {
|
|
|
|
|
|
dom.mark_dirty(ScopeId::APP);
|
|
dom.mark_dirty(ScopeId::APP);
|
|
assert_eq!(
|
|
assert_eq!(
|
|
- dom.render_immediate_to_vec().santize().edits,
|
|
|
|
|
|
+ dom.render_immediate_to_vec().sanitize().edits,
|
|
[
|
|
[
|
|
LoadTemplate { name: "template", index: 0, id: ElementId(2) },
|
|
LoadTemplate { name: "template", index: 0, id: ElementId(2) },
|
|
HydrateText { path: &[0], value: "1".to_string(), id: ElementId(7) },
|
|
HydrateText { path: &[0], value: "1".to_string(), id: ElementId(7) },
|
|
@@ -196,7 +196,7 @@ fn list_shrink_multiroot() {
|
|
|
|
|
|
dom.mark_dirty(ScopeId::APP);
|
|
dom.mark_dirty(ScopeId::APP);
|
|
assert_eq!(
|
|
assert_eq!(
|
|
- dom.render_immediate_to_vec().santize().edits,
|
|
|
|
|
|
+ dom.render_immediate_to_vec().sanitize().edits,
|
|
[
|
|
[
|
|
LoadTemplate { name: "template", index: 0, id: ElementId(10) },
|
|
LoadTemplate { name: "template", index: 0, id: ElementId(10) },
|
|
HydrateText { path: &[0], value: "2".to_string(), id: ElementId(11) },
|
|
HydrateText { path: &[0], value: "2".to_string(), id: ElementId(11) },
|
|
@@ -224,7 +224,7 @@ fn removes_one_by_one_multiroot() {
|
|
|
|
|
|
// load the div and then assign the empty fragment as a placeholder
|
|
// load the div and then assign the empty fragment as a placeholder
|
|
assert_eq!(
|
|
assert_eq!(
|
|
- dom.rebuild_to_vec().santize().edits,
|
|
|
|
|
|
+ dom.rebuild_to_vec().sanitize().edits,
|
|
[
|
|
[
|
|
LoadTemplate { name: "template", index: 0, id: ElementId(1) },
|
|
LoadTemplate { name: "template", index: 0, id: ElementId(1) },
|
|
//
|
|
//
|
|
@@ -251,19 +251,19 @@ fn removes_one_by_one_multiroot() {
|
|
|
|
|
|
dom.mark_dirty(ScopeId::APP);
|
|
dom.mark_dirty(ScopeId::APP);
|
|
assert_eq!(
|
|
assert_eq!(
|
|
- dom.render_immediate_to_vec().santize().edits,
|
|
|
|
|
|
+ dom.render_immediate_to_vec().sanitize().edits,
|
|
[Remove { id: ElementId(10) }, Remove { id: ElementId(12) }]
|
|
[Remove { id: ElementId(10) }, Remove { id: ElementId(12) }]
|
|
);
|
|
);
|
|
|
|
|
|
dom.mark_dirty(ScopeId::APP);
|
|
dom.mark_dirty(ScopeId::APP);
|
|
assert_eq!(
|
|
assert_eq!(
|
|
- dom.render_immediate_to_vec().santize().edits,
|
|
|
|
|
|
+ dom.render_immediate_to_vec().sanitize().edits,
|
|
[Remove { id: ElementId(6) }, Remove { id: ElementId(8) }]
|
|
[Remove { id: ElementId(6) }, Remove { id: ElementId(8) }]
|
|
);
|
|
);
|
|
|
|
|
|
dom.mark_dirty(ScopeId::APP);
|
|
dom.mark_dirty(ScopeId::APP);
|
|
assert_eq!(
|
|
assert_eq!(
|
|
- dom.render_immediate_to_vec().santize().edits,
|
|
|
|
|
|
+ dom.render_immediate_to_vec().sanitize().edits,
|
|
[
|
|
[
|
|
CreatePlaceholder { id: ElementId(8) },
|
|
CreatePlaceholder { id: ElementId(8) },
|
|
Remove { id: ElementId(2) },
|
|
Remove { id: ElementId(2) },
|
|
@@ -318,7 +318,7 @@ fn remove_many() {
|
|
});
|
|
});
|
|
|
|
|
|
{
|
|
{
|
|
- let edits = dom.rebuild_to_vec().santize();
|
|
|
|
|
|
+ let edits = dom.rebuild_to_vec().sanitize();
|
|
assert!(edits.templates.is_empty());
|
|
assert!(edits.templates.is_empty());
|
|
assert_eq!(
|
|
assert_eq!(
|
|
edits.edits,
|
|
edits.edits,
|
|
@@ -331,7 +331,7 @@ fn remove_many() {
|
|
|
|
|
|
{
|
|
{
|
|
dom.mark_dirty(ScopeId::APP);
|
|
dom.mark_dirty(ScopeId::APP);
|
|
- let edits = dom.render_immediate_to_vec().santize();
|
|
|
|
|
|
+ let edits = dom.render_immediate_to_vec().sanitize();
|
|
assert_eq!(
|
|
assert_eq!(
|
|
edits.edits,
|
|
edits.edits,
|
|
[
|
|
[
|
|
@@ -344,7 +344,7 @@ fn remove_many() {
|
|
|
|
|
|
{
|
|
{
|
|
dom.mark_dirty(ScopeId::APP);
|
|
dom.mark_dirty(ScopeId::APP);
|
|
- let edits = dom.render_immediate_to_vec().santize();
|
|
|
|
|
|
+ let edits = dom.render_immediate_to_vec().sanitize();
|
|
assert_eq!(
|
|
assert_eq!(
|
|
edits.edits,
|
|
edits.edits,
|
|
[
|
|
[
|
|
@@ -363,7 +363,7 @@ fn remove_many() {
|
|
|
|
|
|
{
|
|
{
|
|
dom.mark_dirty(ScopeId::APP);
|
|
dom.mark_dirty(ScopeId::APP);
|
|
- let edits = dom.render_immediate_to_vec().santize();
|
|
|
|
|
|
+ let edits = dom.render_immediate_to_vec().sanitize();
|
|
assert_eq!(
|
|
assert_eq!(
|
|
edits.edits,
|
|
edits.edits,
|
|
[
|
|
[
|
|
@@ -379,7 +379,7 @@ fn remove_many() {
|
|
|
|
|
|
{
|
|
{
|
|
dom.mark_dirty(ScopeId::APP);
|
|
dom.mark_dirty(ScopeId::APP);
|
|
- let edits = dom.render_immediate_to_vec().santize();
|
|
|
|
|
|
+ let edits = dom.render_immediate_to_vec().sanitize();
|
|
assert_eq!(
|
|
assert_eq!(
|
|
edits.edits,
|
|
edits.edits,
|
|
[
|
|
[
|