test(techdemo): render slots from hemplate views
Migrate techdemo effect paths and tests from explicit SafeHtml/html payload plumbing to RenderSlotExt view helpers. req: view/001 req: html_safety/002
This commit is contained in:
@@ -5,7 +5,7 @@ pub mod ui {}
|
||||
mod tests {
|
||||
use super::ui;
|
||||
use hemplate::Hemplate;
|
||||
use slhx::{Effect, IntoEffect, Payload, SafeHtml};
|
||||
use slhx::{Effect, IntoEffect, Payload, RenderSlotExt};
|
||||
use slhx_test::inspect;
|
||||
|
||||
#[derive(Hemplate)]
|
||||
@@ -28,7 +28,7 @@ mod tests {
|
||||
fn techdemo_uses_generated_slots_for_multi_target_updates() {
|
||||
fn update() -> impl IntoEffect {
|
||||
(
|
||||
ui::control_center::slots::hero_metrics.html(render_fast_metric("fast")),
|
||||
ui::control_center::slots::hero_metrics.render_view(&FastMetric { label: "fast" }),
|
||||
ui::control_center::slots::notice.text("typed"),
|
||||
)
|
||||
}
|
||||
@@ -38,15 +38,6 @@ mod tests {
|
||||
assert!(batch.has_slot(ui::control_center::slots::notice));
|
||||
}
|
||||
|
||||
fn render_fast_metric(label: &'static str) -> SafeHtml {
|
||||
// req: html_safety/002 req: view/001
|
||||
let mut html = String::new();
|
||||
FastMetric { label }
|
||||
.render_into(&mut html)
|
||||
.expect("techdemo fast metric renders");
|
||||
SafeHtml::trusted(html)
|
||||
}
|
||||
|
||||
// req: examples/001 req: form/001 req: form/004 req: form/006 req: derive_handler/003
|
||||
#[test]
|
||||
fn techdemo_form_handler_is_checked_against_hemplate_form() {
|
||||
|
||||
Reference in New Issue
Block a user