production
This commit is contained in:
@@ -135,12 +135,31 @@ void main() {
|
||||
expect(ServiceDay.belongsToToday(row, now: '2026-08-22'), isFalse);
|
||||
});
|
||||
|
||||
test('a record with no date is kept, quietly', () {
|
||||
// A payload defect is not evidence the work happened yesterday, and it
|
||||
// is not something to print on the rider's screen either.
|
||||
test('a record with no date is excluded, and reported', () {
|
||||
// ── This assertion was inverted, deliberately ──
|
||||
//
|
||||
// It used to read `isTrue`: a payload defect was held not to be evidence
|
||||
// the work happened yesterday, so an undated row was admitted to today.
|
||||
// That reasoning had the burden of proof backwards. `GET /miler/bookings`
|
||||
// returns the rider's whole open set, so "the API sent it" says nothing
|
||||
// about *when* — and this branch turned out to be the hole yesterday's
|
||||
// finished bookings came through, on a screen whose entire premise is
|
||||
// that everything on it happened today.
|
||||
//
|
||||
// A row that cannot prove it is today's is not shown today. Nothing is
|
||||
// deleted: [ServiceDay.of] still answers, both local stores keep their
|
||||
// records, and the backend is untouched. It is a view filter.
|
||||
//
|
||||
// Still not something to print on the rider's screen — he can do nothing
|
||||
// about a backend row with no timestamp — so it goes to the console
|
||||
// instead of to a badge. See [ServiceDay.logUndated].
|
||||
final row = {'orderid': 'x', 'orderstatus': 'delivered'};
|
||||
expect(ServiceDay.belongsToToday(row), isTrue);
|
||||
expect(ServiceDay.belongsToToday(row), isFalse);
|
||||
expect(ServiceDay.of(row), '');
|
||||
|
||||
final reported = <Map<String, dynamic>>[];
|
||||
ServiceDay.belongsToToday(row, onUndated: reported.add);
|
||||
expect(reported, [row], reason: 'excluded, but never in silence');
|
||||
});
|
||||
|
||||
test('a timestamp is used when no day stamp was written', () {
|
||||
|
||||
Reference in New Issue
Block a user