updates on the minor changes like zone updates and datepicker fix
This commit is contained in:
@@ -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', () => {
|
||||
|
||||
Reference in New Issue
Block a user