feat(examples): add flagship techdemo
req: examples/001 req: dx/008 req: form/002 req: page_swap/002 req: push/003
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
#[slhx::surface]
|
||||
pub mod ui {}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::ui;
|
||||
use slhx::{IntoEffect, SafeHtml};
|
||||
use slhx_test::inspect;
|
||||
|
||||
// req: examples/001 req: codegen/002 req: public_api/001
|
||||
#[test]
|
||||
fn techdemo_uses_generated_slots_for_multi_target_updates() {
|
||||
fn update() -> impl IntoEffect {
|
||||
(
|
||||
ui::control_center::slots::hero_metrics.html(SafeHtml::trusted("<b>fast</b>")),
|
||||
ui::control_center::slots::notice.text("typed"),
|
||||
)
|
||||
}
|
||||
|
||||
let batch = inspect(update());
|
||||
assert!(batch.has_slot(ui::control_center::slots::hero_metrics));
|
||||
assert!(batch.has_slot(ui::control_center::slots::notice));
|
||||
}
|
||||
|
||||
// req: examples/001 req: form/002 req: codegen/003
|
||||
#[test]
|
||||
fn techdemo_exports_form_and_interaction_handles() {
|
||||
assert_ne!(ui::control_center::handles::launch_work.id().id, ui::control_center::handles::advance_work.id().id);
|
||||
assert_eq!(
|
||||
ui::control_center::forms::launch_work.field("title").resource,
|
||||
ui::control_center::forms::launch_work.id()
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user