freshyo/docs/test-cases/location-region-switching.md
2026-10-13 19:10:27 +05:30

4.1 KiB

Location resolution and region switching

Scope: native location store/useRegion, web region gate/store, manual selector, GPS attachment. The browsing region is in-memory only and never persisted: every launch re-derives it from the device location and/or the default address.

ID Priority Action / input Expected result
LOC-01 P0 Fresh signed-out/signed-in launch inside A. One-shot resolution selects A; bound/catalog loads without mandatory login.
LOC-02 P1 Permission denied/permanently denied/GPS unavailable. A usable manual chooser (and, when a default address exists, that region); no silently "remembered" region, since none is persisted.
LOC-03 P1 Coordinates outside all bounds; empty regions list. Useful unavailable-service state, not endless spinner.
LOC-04 P0 Delayed GPS A response after manual B selection. Late automatic response cannot undo manual choice.
LOC-05 P1 Location changes A→B while app remains open. No unexpected continuous cart-clearing auto-switch.
LOC-06 P0 Both A carts populated; request B switch, cancel then confirm. Cancel preserves all; confirm clears regional carts/slots/coupons/address context and loads B.
LOC-07 P0 Rapid A→B→A with delayed catalog responses. Region-generation guard rejects stale B/A responses and mixed prices.
LOC-08 P1 Relaunch after the region's service metadata changed/removed. Region re-derived (nothing persisted); changed metadata revalidated; no stale cached context.
LOC-09 P1 Cold launch physically in B with A carts. One-shot resolution follows the anchored startup decision; region adoption does not clear the local cart; no silent mixed-region order.
LOC-10 P1 U1 A/B addresses; default B while browsing A. No automatic foreign default override; A browsing choice retained.
LOC-11 P0 Explicit foreign-address switch confirm/cancel. Same safe region-switch behavior and cleared regional state.
LOC-12 P1 Saved address without a stored bound. Bound is derived from the address coordinates; never a foreign region's bound; warnings accurate.
LOC-13 P1 Shared location-store consumers mount/unmount repeatedly. No duplicate listeners/resolutions or memory leaks affecting selection.
LOC-14 P2 Browser refresh/SSR/private-mode. No hydration crash; usable manual region selector.
LOC-15 P1 Force-quit during confirmed switch/state clearing. Relaunch coherent region and carts; no half-reset checkout.
LOC-16 P1 Resolve request offline/timeout, then restore network. Bounded retry; manual selection remains usable.
LOC-17 P2 Emulator/mock-location environment vs physical device. Supported location path without production-only/emulator-only assumptions.
LOC-18 P0 Change region while submit request is pending. No duplicate order or new-region UI falsely representing old-region order.
LOC-19 P0 Cold launch (a) with a default address in the resolved region, (b) with the location resolving to another serviceable region, (c) with location off/out-of-area and a default address, (d) with no default address. (a) use the default silently; (b) ask the user to choose; (c) use the default; (d) use the resolved region, else ask.
LOC-20 P1 Set a region → force-quit → relaunch with location unavailable. Nothing is persisted: the region is re-derived (default address / location); when neither resolves a chooser appears — a previously set region does not silently survive.
LOC-21 P0 Cold start adopts the first region while a local cart has items. Adoption uses the non-clearing path (local cart preserved). Only an explicit switch away from an already-set region confirms and clears regional state.
LOC-22 P1 Launch with location access denied, then with device location services off, then with permission granted but no fix. Distinct messages ("access not granted" vs "services off" vs "couldn't get a fix") plus an "Open location settings" action, then an address-chooser fallback.

Open policy: exact cold-start/manual-choice precedence after a populated local cart. Do not label ambiguity PASS.