updates on the zone fix

This commit is contained in:
2026-10-06 19:33:02 +05:30
parent 7aca6a6a48
commit 21775fe6f9
3 changed files with 25 additions and 36 deletions

View File

@@ -104,16 +104,11 @@ describe('a tenant session never matches on a hub id', () => {
})).toBe(true);
});
it('a client who picks a Doormile HUB is matched on hub ids, never on location ids', () => {
it('a client cannot pick a Doormile hub: a stale hub id falls back to All Zones', () => {
const { result } = setup({ user: { tenantid: '13' }, locations: [KITCHEN] });
expect(inZone(result, '5', {
bookingid: 5, bookingno: 'DM-H', tenantid: '13', pickuphubid: 5,
pickupaddress: 'Gate 3', deliveryaddress: 'Block C'
})).toBe(true);
expect(inZone(result, '5', {
bookingid: 6, bookingno: 'DM-L', tenantid: '13', tenantlocationid: 5,
pickupaddress: 'Gate 3', deliveryaddress: 'Block C'
})).toBe(false);
expect(result.current.zones.map((z) => z.hubid)).not.toContain('5');
act(() => result.current.setSelectedZoneId('5'));
expect(result.current.isAllZones).toBe(true);
});
it("never shows a client another tenant's order, whatever zone is picked", () => {