Files
doormile_milderapp/test/deliveries_queue_visible_test.dart
Thiru-tenext d7348e253f Miler rider app: surface system, visible design language, backend lifecycle
Design system
- MilerSurface ladder (canvas → working → raised → floating) with MilerPanel
  as layer 1; canvas moved to #DEE3EA so white separates at 1.290:1.
- Visible vocabulary applied across Home, Deliveries, Activity, Account and
  the sheets: hero heads (tabular numeral + small caption, clamped at 1.3x),
  canvas wells for anything that opens, small filled tags for shelf labels,
  demoted placeholders. Recorded in DESIGN_SYSTEM.md §6.
- One icon family: 222 Material glyphs migrated to Lucide; none left outside
  lib/xpress.
- Colour semantics corrected: amber only for what is genuinely owed, brand red
  reserved for the live stop, disabled primaries go neutral rather than pale.

Data and lifecycle
- lib/data/lifecycle.dart reads mutations for what they prove; route_order.dart
  makes admin sequence the single ordering authority; service_day.dart, and
  stop_area.dart rewritten against live Coimbatore addresses (digit-token
  stripping, city stoplist, street suffixes, stammer collapse).
- countLabel states the load once, in bags.

Testing
- 1440 tests passing; golden shot harnesses for Home, Deliveries, Activity,
  sheets and verify, with test/failures/ now gitignored (diff debris).
- New pins: home_gutter_test, stop_area_test, plus updated structural bounds.

Note: this commit also carries pre-existing working-tree deletions that were
present before this work (API_SPEC.md, README.md, demo test fixtures).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-22 05:40:35 +05:30

62 lines
2.6 KiB
Dart

import 'package:flutter_test/flutter_test.dart';
import 'package:miler/Models/stop_status.dart';
import 'package:miler/data/service_profile.dart';
/// ─────────────────────────────────────────────────────────────────────────
/// A COLLECTED MILK RUN MUST STILL HAVE CARDS
///
/// The Deliveries queue filtered on the raw rung — `!status.isPicked` — while
/// the progress rail directly above it read the profile-aware
/// [StopStatusX.isWorkComplete].
///
/// On a parcel route the two agree by accident: collection IS the end of that
/// job. On a milk run they disagree completely — `picked` is the middle of the
/// morning, with fifteen lunches in the rider's hands and none delivered. So
/// collecting a crate emptied the card list while the rail kept drawing the
/// stop as a node: a rail with work on it and nothing underneath.
/// ─────────────────────────────────────────────────────────────────────────
void main() {
tearDown(() => ServiceProfile.setActive(ServiceProfile.parcel));
/// The queue's filter, as the screen applies it.
bool worked(StopStatus s) => !s.isCancelled && !s.isWorkComplete;
group('milk run', () {
setUp(() => ServiceProfile.setActive(ServiceProfile.milkMan));
test('a collected crate is still work, so it still has a card', () {
expect(worked(StopStatus.picked), isTrue);
expect(worked(StopStatus.outForDelivery), isTrue);
expect(worked(StopStatus.deliveryArrived), isTrue);
});
test('and it leaves the queue at the door, not at the kitchen', () {
expect(worked(StopStatus.delivered), isFalse);
expect(worked(StopStatus.cancelled), isFalse);
});
test('the rail and the card list agree at every rung', () {
// The bug in one assertion: these two predicates drove the same screen
// and disagreed about `picked`.
for (final s in StopStatus.values) {
expect(
worked(s),
isNot(s.isWorkComplete),
reason: '$s renders a node on the rail but no card, or the reverse',
);
}
});
});
group('parcel route', () {
setUp(() => ServiceProfile.setActive(ServiceProfile.parcel));
test('collection is the end of the job, so the card goes', () {
expect(worked(StopStatus.accepted), isTrue);
expect(worked(StopStatus.arrived), isTrue);
expect(worked(StopStatus.picked), isFalse);
});
});
}