feat(workout): make finish export a product state

Promote the finish/export card from static copy into session-aware product state and extend the HTTP exemplar through full finish, export, and replay.

req: examples/001

req: local/001

req: local/003

req: local/004
This commit is contained in:
slhx agent
2026-06-11 23:29:09 +02:00
parent c146e9b932
commit 900ae9f51f
4 changed files with 72 additions and 8 deletions
+23 -2
View File
@@ -87,6 +87,27 @@ fn workout_is_e2e_working_over_http() {
assert_payload_contains(&completed_batch, "Start Goblet squat set 2");
assert_payload_contains(&completed_batch, "1 of 5 sets · 20% complete");
let complete_body = handle_body_from_html(&home.text(), "Complete set");
let mut final_step = completed;
for _ in 0..9 {
final_step = post(&server, "/", &complete_body);
assert_effect_response(&final_step);
}
let final_batch = final_step.effects();
assert_payload_contains(&final_batch, "finished workout: 5/5 sets complete");
assert_payload_contains(&final_batch, "Workout saved");
assert_payload_contains(&final_batch, "Share final export");
let exported = post(
&server,
"/",
&handle_body_from_html(&home.text(), "Export after first set"),
);
assert_effect_response(&exported);
let exported_batch = exported.effects();
assert_payload_contains(&exported_batch, "Share export prepared");
assert_payload_contains(&exported_batch, "Share sheet requested");
let replayed = post(
&server,
"/",
@@ -94,10 +115,10 @@ fn workout_is_e2e_working_over_http() {
);
assert_effect_response(&replayed);
let replayed_batch = replayed.effects();
assert_payload_contains(&replayed_batch, "Replayed 1 exported workout events");
assert_payload_contains(&replayed_batch, "Replayed 10 exported workout events");
assert_payload_contains(
&replayed_batch,
"Replayed 1 exported events into a fresh projection",
"Replayed 10 exported events into a fresh projection",
);
}