Preserve native interaction semantics
This commit is contained in:
@@ -49,7 +49,7 @@ fn inspects_generated_targets_and_handles_without_raw_runtime_ids() {
|
||||
let target = TestTarget(ResourceKind::Slot, 42);
|
||||
let handle = hemx_core::Handle::<()>::new(7);
|
||||
let inspected = hemx_test::inspect_html_fragment(
|
||||
r#"<section data-sid="42"><button data-hid="7">Save</button></section>"#,
|
||||
r#"<section data-hemx-resource="42"><button data-hemx-action="7">Save</button></section>"#,
|
||||
);
|
||||
|
||||
inspected.assert_target(target);
|
||||
@@ -100,7 +100,7 @@ fn inspects_generated_target_document_and_fragment_payloads() {
|
||||
Effect::Insert {
|
||||
target: ResourceRef::unscoped(ResourceId::new(ResourceKind::Slot, 2)),
|
||||
position: InsertPosition::Last,
|
||||
html: SafeHtml::trusted("<li data-key=later>later</li>"),
|
||||
html: SafeHtml::trusted("<li data-hemx-key=later>later</li>"),
|
||||
},
|
||||
"Insert",
|
||||
),
|
||||
@@ -108,7 +108,7 @@ fn inspects_generated_target_document_and_fragment_payloads() {
|
||||
Effect::Insert {
|
||||
target: ResourceRef::unscoped(ResourceId::new(ResourceKind::Slot, 2)),
|
||||
position: InsertPosition::First,
|
||||
html: SafeHtml::trusted("<li data-key=first>first</li>"),
|
||||
html: SafeHtml::trusted("<li data-hemx-key=first>first</li>"),
|
||||
},
|
||||
"Insert",
|
||||
),
|
||||
@@ -116,7 +116,7 @@ fn inspects_generated_target_document_and_fragment_payloads() {
|
||||
let fragment = hemx_test::inspect(effect)
|
||||
.target_html_fragment(TestTarget(ResourceKind::Slot, 2))
|
||||
.unwrap();
|
||||
fragment.assert_count("li[data-key]", 1);
|
||||
fragment.assert_count("li[data-hemx-key]", 1);
|
||||
assert!(fragment.origin().contains(operation));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@ fn inspector_predicates_bind_operation_target_scope_kind_and_payload() {
|
||||
Effect::Patch {
|
||||
target: keyed_ref.clone(),
|
||||
mode: PatchMode::Replace,
|
||||
html: SafeHtml::trusted("<li data-key=\"row-1\">replacement</li>"),
|
||||
html: SafeHtml::trusted("<li data-hemx-key=\"row-1\">replacement</li>"),
|
||||
},
|
||||
Effect::Insert {
|
||||
target: ResourceRef::unscoped(resource),
|
||||
@@ -202,7 +202,7 @@ fn inspector_predicates_bind_operation_target_scope_kind_and_payload() {
|
||||
assert!(!inspected.payload_excludes_key("row-1"));
|
||||
assert_eq!(
|
||||
inspected.target_html_containing(expected, "replacement"),
|
||||
Some("<li data-key=\"row-1\">replacement</li>")
|
||||
Some("<li data-hemx-key=\"row-1\">replacement</li>")
|
||||
);
|
||||
assert_eq!(
|
||||
inspected.target_html_containing(expected, "inserted"),
|
||||
|
||||
Reference in New Issue
Block a user