updates on the minor changes like zone updates and datepicker fix

This commit is contained in:
2026-09-28 15:36:59 +05:30
parent 3bde09839c
commit 5bf0104b61
8 changed files with 284 additions and 22 deletions

View File

@@ -347,10 +347,19 @@ describe('ZoneContext', () => {
expect(result.current.matchesZone({ milerprofileid: 11, hubid: '2' })).toBe(true);
});
it('should match a rider by their app location', () => {
it('should match a rider by their app location (city id against city id)', () => {
localStorage.setItem(ZONE_STORAGE_KEY, '2');
const { result } = setup();
expect(result.current.matchesZone({ milerprofileid: 11, applocationid: '2' })).toBe(true);
const { result } = setup({ hubs: [{ ...KORAMANGALA, applocationid: '3' }] });
expect(result.current.matchesZone({ milerprofileid: 11, applocationid: '3' })).toBe(true);
});
// Regression: a rider's applocationid (a CITY id) was also compared with the
// selected HUB id. Coimbatore Neptune Hub is hubid 2 in city 1, Hyderabad is
// city 2 — so every Hyderabad rider matched the Coimbatore zone.
it('should not match a rider whose city id merely equals the hub id', () => {
localStorage.setItem(ZONE_STORAGE_KEY, '2');
const { result } = setup({ hubs: [{ ...KORAMANGALA, applocationid: '1' }] });
expect(result.current.matchesZone({ milerprofileid: 11, applocationid: '2', hubid: null })).toBe(false);
});
it('should match a rider by city when they carry no hub id', () => {