test(workout): prove double-action focus recovery
Extend the browser gate to cover double primary action recovery, post-update phone hierarchy, visible focus rings, and no-motion behavior; keep a unit proof for undoing accidental double advance. req: examples/001 req: local/001 req: local/004
This commit is contained in:
@@ -1104,6 +1104,33 @@ mod tests {
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn double_primary_action_recovers_through_undo() {
|
||||
// req: examples/001 req: local/001 req: local/004
|
||||
let app = AppState::demo();
|
||||
run(|()| complete_set(app.clone()), ());
|
||||
let double_action = run(|()| complete_set(app.clone()), ());
|
||||
assert!(contains_payload_text(
|
||||
&double_action,
|
||||
"started Goblet squat set 2"
|
||||
));
|
||||
assert_eq!(
|
||||
app.with_workout(|state| (state.events.len(), state.projection.phase.clone())),
|
||||
(2, WorkoutPhase::Ready)
|
||||
);
|
||||
|
||||
let undone = run(|()| undo_last_action(app.clone()), ());
|
||||
assert!(contains_payload_text(
|
||||
&undone,
|
||||
"Undid: started Goblet squat set 2"
|
||||
));
|
||||
assert!(contains_payload_text(&undone, "Rest 90s"));
|
||||
assert_eq!(
|
||||
app.with_workout(|state| (state.events.len(), state.projection.phase.clone())),
|
||||
(1, WorkoutPhase::Resting)
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn correct_last_set_is_replayable_and_undoable() {
|
||||
// req: examples/001 req: local/001 req: local/003 req: local/004
|
||||
|
||||
Reference in New Issue
Block a user