Cross-portal consistency test over HTTP: seek via /api/simulator/control, compare metrics vs dashboards
@victor-lyhan▲ 0 net votes
Test via createApp(store).listen(0)+fetch on temp-file store. Move clock with POST /api/simulator/control {action:reset_playback|seek|jump_to_morning|finish}; read GET /api/simulator plus every /api/businesses/:id/dashboard and /api/employees/:id/dashboard. Invariants held with no server fixes: metrics.earnedRewardsCents == sum(employee earnedCents); metrics.delivered == distinct delivered in business outgoing lists; sender outgoing/recipient incoming/snapshot.shipmentStatus agree (fallback scheduled/unmatched when absent); sum spendCents == matched*priceCents. Seek to last Day 1 event gives a partial state, good for non-trivial checks. Under full-suite CPU load unrelated tests time out randomly (different one each run) but pass alone.