fix: form field alignment, raw maintenance text, and static movements list
- .form-grid labels (missing-field form, odometer-regression correction fields)
and the odometer/overlap note textareas had no stacked label-above-input
styling at all -- the shared rule only covered .filters/.return-form, so these
fell back to default inline browser layout with mismatched input widths.
Extended the existing rule to cover .form-grid and label:has(> textarea).
- Vehicle maintenance list showed the raw, untranslated seed text
("Synthetic scheduled service record") regardless of locale -- purely
decorative and 1:1 redundant with the (already-translated) category. Replaced
it with the record's real odometer reading, mirroring the sibling
Inspections tab's pattern.
- "Today's movements" was always the same fixed 4 bookings (2 returns, 2
departures) on every reset, reading as a static mockup rather than live
fleet activity. Added 8 more bookings anchored to land on "today" across 8
additional vehicles, spread through the day.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
9e9dd8e0e3
commit
c2b8268927
@@ -22,7 +22,9 @@ def test_seed_counts_match_deterministic_dataset():
|
||||
reset_and_seed(db)
|
||||
assert db.scalar(select(func.count()).select_from(Vehicle)) == 50
|
||||
assert db.scalar(select(func.count()).select_from(Customer)) == 180
|
||||
assert db.scalar(select(func.count()).select_from(Booking)) == 246
|
||||
# 246 original plus 8 (BK-T-001..008) added so "Today's movements" reads as a
|
||||
# real day of traffic rather than the same fixed 4 rows on every reset.
|
||||
assert db.scalar(select(func.count()).select_from(Booking)) == 254
|
||||
# 21 from the CSV (15 original + 6 giving every unexplained blocked vehicle a
|
||||
# real open issue) plus a deterministic set discovered by the post-seed scan. The
|
||||
# shared vehicle-status evaluator (app.services.vehicle_status) also catches
|
||||
@@ -181,9 +183,10 @@ def test_seed_dates_are_anchored_to_reset_moment():
|
||||
|
||||
|
||||
def test_seed_today_movements_are_a_credible_mix():
|
||||
"""A fresh reset must not land on a dead 'Today's movements' dashboard section:
|
||||
at least two departures and two returns should fall on the reset day, mirroring
|
||||
the same status/date rule the dashboard router uses to build the today list."""
|
||||
"""A fresh reset must not land on a thin, always-identical 'Today's movements'
|
||||
dashboard section: a real day of fleet traffic (>=5 departures, >=5 returns, across
|
||||
more than 4 distinct vehicles) should fall on the reset day, mirroring the same
|
||||
status/date rule the dashboard router uses to build the today list."""
|
||||
db = SessionLocal()
|
||||
try:
|
||||
reset_and_seed(db)
|
||||
@@ -197,8 +200,10 @@ def test_seed_today_movements_are_a_credible_mix():
|
||||
returns = [
|
||||
b for b in bookings if b.ends_at.date() == today and b.status in ("active", "returned")
|
||||
]
|
||||
assert len(departures) >= 2
|
||||
assert len(returns) >= 2
|
||||
assert len(departures) >= 5
|
||||
assert len(returns) >= 5
|
||||
vehicles_involved = {b.vehicle_id for b in departures} | {b.vehicle_id for b in returns}
|
||||
assert len(vehicles_involved) > 4
|
||||
finally:
|
||||
db.close()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user