production
This commit is contained in:
@@ -225,6 +225,55 @@ void main() {
|
||||
final p = await resolveWith({'tenantname': 'nobody', 'tenantid': 4242});
|
||||
expect(p.line, ServiceLine.parcel);
|
||||
});
|
||||
|
||||
test('a known tenant id outranks a name that contradicts it', () async {
|
||||
// ── The loose end in a one-shot global flag ──
|
||||
//
|
||||
// Tenant 13 is the meal client, and its display name is whatever was
|
||||
// typed into the tenant record — plausibly the owning company's. A name
|
||||
// normalising to `doormile` matched the Logistics list, won on
|
||||
// name-first, and the id was never consulted.
|
||||
//
|
||||
// On Logistics `MyPickups._unreleased` is empty by design, so the
|
||||
// **Start round** bar does not render. With
|
||||
// `MILER_COLLECTED_STATE_ENABLED` on, that rider's collected parcels
|
||||
// strand at `Collected_By_Miler` with no control to release them.
|
||||
for (final name in const ['Doormile', 'doormile', 'DOOR-MILE']) {
|
||||
final p = await resolveWith({'tenantname': name, 'tenantid': 13});
|
||||
expect(
|
||||
p.line,
|
||||
ServiceLine.milkMan,
|
||||
reason: 'tenant 13 is the meal client whatever it is called ($name)',
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
test('a long legal name is harmless — it simply is not an answer', () async {
|
||||
// The case the backend team asked about. It matches neither list, so it
|
||||
// falls through to the id exactly as an empty name would.
|
||||
expect(
|
||||
TenantController.profileForName('Daily Grubs Foods Pvt Ltd'),
|
||||
isNull,
|
||||
);
|
||||
final p = await resolveWith({
|
||||
'tenantname': 'Daily Grubs Foods Pvt Ltd',
|
||||
'tenantid': 13,
|
||||
});
|
||||
expect(p.line, ServiceLine.milkMan);
|
||||
});
|
||||
|
||||
test('a tenant this build has never heard of is still decided by name',
|
||||
() async {
|
||||
// The property name-first existed for, and it must survive the change
|
||||
// above: a NEW meal client, absent from the id list, costs no release.
|
||||
final p = await resolveWith({'tenantname': 'milkrun', 'tenantid': 999});
|
||||
expect(p.line, ServiceLine.milkMan);
|
||||
|
||||
// And the mirror — a new logistics client is not dragged onto the meal
|
||||
// line by an id nobody has listed.
|
||||
final q = await resolveWith({'tenantname': 'logistics', 'tenantid': 998});
|
||||
expect(q.line, ServiceLine.parcel);
|
||||
});
|
||||
});
|
||||
|
||||
group('what each mode can and cannot do', () {
|
||||
|
||||
Reference in New Issue
Block a user