Fix Doris Barbell band logging and nav links
This commit is contained in:
@@ -386,7 +386,8 @@ def test_homepage_renders_core_sections_and_forms(tmp_path: Path) -> None:
|
||||
assert 'Add exercise template' in body
|
||||
assert 'Current routine board' in body
|
||||
assert 'Monday: Chest' in body
|
||||
assert 'Doris family directory' not in body
|
||||
assert 'Doris family directory' in body
|
||||
assert 'Singular front door' in body
|
||||
assert 'V1 focus' not in body
|
||||
assert 'Next likely build' not in body
|
||||
|
||||
@@ -505,6 +506,50 @@ def test_seeded_routine_log_uses_numeric_target_reps_when_reps_left_blank(tmp_pa
|
||||
]
|
||||
|
||||
|
||||
def test_seeded_routine_log_allows_band_exercises_without_weight(tmp_path: Path) -> None:
|
||||
client = make_client(tmp_path)
|
||||
|
||||
summary = client.get('/api/dashboard/summary').json()
|
||||
shoulders = next(routine for routine in summary['routines'] if routine['name'] == 'Thursday: Shoulders')
|
||||
|
||||
response = client.post(
|
||||
'/workouts/routine-log',
|
||||
data={
|
||||
'user_id': 'john',
|
||||
'routine_id': shoulders['id'],
|
||||
'performed_at': '2026-05-28T12:05:00',
|
||||
'routine_name': shoulders['name'],
|
||||
'notes': 'Band work without tracked weight.',
|
||||
'exercise_count': '1',
|
||||
'exercise_0_name': 'Resistance Band Punch-Out Training',
|
||||
'exercise_0_set_count': '3',
|
||||
'exercise_0_set_0_reps': '',
|
||||
'exercise_0_set_0_weight_lbs': '',
|
||||
'exercise_0_set_1_reps': '',
|
||||
'exercise_0_set_1_weight_lbs': '',
|
||||
'exercise_0_set_2_reps': '',
|
||||
'exercise_0_set_2_weight_lbs': '',
|
||||
},
|
||||
follow_redirects=False,
|
||||
)
|
||||
|
||||
assert response.status_code == 303
|
||||
assert response.headers['location'] == '/'
|
||||
|
||||
workout_history = client.get('/api/history/john/workouts')
|
||||
assert workout_history.status_code == 200
|
||||
payload = workout_history.json()
|
||||
assert payload[0]['routine_name'] == 'Thursday: Shoulders'
|
||||
assert payload[0]['set_count'] == 3
|
||||
assert payload[0]['total_volume_lbs'] == 0
|
||||
assert payload[0]['exercises'][0]['exercise_name'] == 'Resistance Band Punch-Out Training'
|
||||
assert payload[0]['exercises'][0]['sets'] == [
|
||||
{'reps': 10, 'weight_lbs': None},
|
||||
{'reps': 10, 'weight_lbs': None},
|
||||
{'reps': 10, 'weight_lbs': None},
|
||||
]
|
||||
|
||||
|
||||
def test_existing_state_gets_seeded_routine_backfill(tmp_path: Path) -> None:
|
||||
state_path = tmp_path / 'state.json'
|
||||
state_path.write_text(
|
||||
|
||||
Reference in New Issue
Block a user