import 'package:flutter_test/flutter_test.dart'; import 'package:miler/controllers/pickups_controller.dart'; /// Whichever way the proximity fence is set, it must be set **once** and on /// purpose. /// /// [kGeofenceEnforced] decides whether "Picked up" means the rider was standing /// at the door or merely pressed a button, and it has already been wrong in /// both directions: it was `kDebugMode` — so every debug build had no fence and /// the fence was therefore never tested — and then a hard `false`, so the flow /// could not be walked at a desk at all. /// /// **It is currently OFF**, decided on 2026-08-19 because the fence was /// refusing real work: riders pressing *Picked up* at a counter were told they /// were kilometres away, most often because the booking's own coordinates were /// wrong rather than the rider. See the declaration for the full reasoning and /// for how to restore it. /// /// So this file no longer guards a direction. It guards the two properties that /// made the old defaults dangerous: that the state is *deliberate*, and that /// every gate reads the same switch. void main() { test('there is one switch, and the legacy name derives from it', () { // Two constants that could disagree is exactly how a build ends up with // the fence on in one gate and off in the other — the bulk check on Home // and the per-stop check in the controller are separate code paths that // must never answer differently. expect(kBypassGeofenceForTesting, !kGeofenceEnforced); }); test('enforcement is off, and that is the recorded decision', () { // If this fails, one of two things happened, and both should be read rather // than silenced: // // • the default was changed back to enforced — which is the intended // end state, so update this test with the date and the reason; or // • this run passed `--dart-define=ENFORCE_GEOFENCE=true`, in which case // the failure is correct and is telling you this build has the fence on. expect( kGeofenceEnforced, isFalse, reason: 'Proximity enforcement is expected to be OFF (see kGeofenceEnforced). ' 'Either the default was restored, or this run passed ' '--dart-define=ENFORCE_GEOFENCE=true.', ); }); }