feat(host): wire techdemo host capability flow
Route browser/PWA share and native-shell haptic host results through techdemo app code before returning normal hemx effects; serve the tiny browser host adapter as an app asset. req: host/001 req: host/002 req: host/004 req: host/005 req: examples/001
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
use hemx_axum::runtime_js_path;
|
||||
use hemx_techdemo::ui::control_center::{self as control, launch_work, reset_demo, simulate_push};
|
||||
use hemx_techdemo::ui::host_panel::{
|
||||
record_browser_share, record_native_haptic_ack, request_browser_share, request_native_haptic,
|
||||
};
|
||||
use hemx_techdemo::ui::issue_card::{advance_work, delete_work, spotlight_work};
|
||||
use hemx_techdemo::ui::issue_lane::move_to_lane as move_to_lane_handle;
|
||||
use hemx_techdemo::ui::BUILD_FINGERPRINT;
|
||||
@@ -256,6 +259,53 @@ fn product_is_e2e_working_over_http() {
|
||||
);
|
||||
assert_emit(&push_batch, &island_event_name("orbit"), "activity rows");
|
||||
|
||||
let browser_host_request = post("/", &handle_form_body(request_browser_share, &[]));
|
||||
assert_effect_response(&browser_host_request);
|
||||
let browser_request_batch = browser_host_request.effects();
|
||||
assert_payload_contains(&browser_request_batch, "Browser host call requested");
|
||||
assert_payload_contains(
|
||||
&browser_request_batch,
|
||||
"Browser/PWA share request accepted; waiting for HostEvent",
|
||||
);
|
||||
assert_emit(&browser_request_batch, "hemx:host-call", "browser-share-1");
|
||||
|
||||
let browser_host_result = post(
|
||||
"/",
|
||||
&handle_form_body(record_browser_share, &[("completed", "true")]),
|
||||
);
|
||||
assert_effect_response(&browser_host_result);
|
||||
let browser_result_batch = browser_host_result.effects();
|
||||
assert_payload_contains(
|
||||
&browser_result_batch,
|
||||
"Browser/PWA HostEvent became an app command before UI effects.",
|
||||
);
|
||||
assert_payload_contains(
|
||||
&browser_result_batch,
|
||||
"Browser share completed through app host pipeline",
|
||||
);
|
||||
|
||||
let native_host_request = post("/", &handle_form_body(request_native_haptic, &[]));
|
||||
assert_effect_response(&native_host_request);
|
||||
let native_request_batch = native_host_request.effects();
|
||||
assert_payload_contains(&native_request_batch, "Native host call requested");
|
||||
assert_payload_contains(
|
||||
&native_request_batch,
|
||||
"Native-shell haptic request accepted; waiting for host acknowledgment.",
|
||||
);
|
||||
assert_emit(&native_request_batch, "hemx:host-call", "native-haptic-tap");
|
||||
|
||||
let native_host_result = post("/", &handle_form_body(record_native_haptic_ack, &[]));
|
||||
assert_effect_response(&native_host_result);
|
||||
let native_result_batch = native_host_result.effects();
|
||||
assert_payload_contains(
|
||||
&native_result_batch,
|
||||
"Native-shell HostEvent became an app command before UI effects.",
|
||||
);
|
||||
assert_payload_contains(
|
||||
&native_result_batch,
|
||||
"Native haptic acknowledgment accepted by app code",
|
||||
);
|
||||
|
||||
let delete_missing = post("/", &handle_form_body(delete_work, &[("work_id", "999")]));
|
||||
assert_effect_response(&delete_missing);
|
||||
let delete_missing_batch = delete_missing.effects();
|
||||
|
||||
Reference in New Issue
Block a user