production
This commit is contained in:
@@ -196,6 +196,38 @@ void main() {
|
||||
);
|
||||
expect(deliveries.map(MilkRun.idOf), ['A1']);
|
||||
});
|
||||
|
||||
test('a delivered stop leaves the count, not just the list', () {
|
||||
// ── The two screens disagreed because they asked different questions ──
|
||||
//
|
||||
// Both call `deliveryQueue`, which is supposed to be what stops that
|
||||
// happening. It cannot, when they pass different arguments: Deliveries
|
||||
// passed `closedIds`, Home's pill did not. The rider finished a drop,
|
||||
// watched the tab go 22 → 21, and came back to Home still holding 22.
|
||||
//
|
||||
// Worse on Home than a plain lag, because Home *stamps* a closed stop
|
||||
// `picked` so its row cannot flicker back to LIVE while the queue
|
||||
// catches up — and `picked` is squarely inside the delivery domain. The
|
||||
// pill was counting the stamp that existed to hide the stop.
|
||||
final day = [
|
||||
order('B1', status: 'picked'),
|
||||
order('B2', status: 'picked'),
|
||||
];
|
||||
|
||||
expect(WorkBoundary.deliveryQueue(day).length, 2);
|
||||
expect(
|
||||
WorkBoundary.deliveryQueue(day, closedIds: const {'B1'}).length,
|
||||
1,
|
||||
reason: 'the finished drop is off both the list and the count',
|
||||
);
|
||||
|
||||
// And it does not reappear on Home instead — closed is closed, not
|
||||
// handed back across the boundary.
|
||||
expect(
|
||||
WorkBoundary.pickupQueue(day, closedIds: const {'B1'}).length,
|
||||
0,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
group('logistics — the boundary is acceptance, and that is unchanged', () {
|
||||
|
||||
Reference in New Issue
Block a user