Skip to main content

Test Inventory — SAPOT Mobile App

Revised: 2026-06-20 Scope: React Native / Expo frontend + FastAPI backend

Execution Type Definitions

TypeDefinition
AUTOMATEDRuns in CI without human intervention or physical device (Jest, RNTL, Pytest, pytest-asyncio)
HYBRIDScripted but requires a real device or emulator at runtime (Maestro flows, WS integration)
MANUALRequires a human tester on a physical device with real network conditions, hardware, or OS-level state that cannot be scripted

Coverage Summary

AreaFeaturesExisting TestsCoverage Status
Auth flows18 hooks/utils/components17 test filesPartial — missing register, lockout timer, all reset hooks
Chat6 services/repos/hooks9 test filesPartial — missing public-chat service, chat hooks, ID utils
Call3 services/hooks/repos1 test fileLow — only CallService unit test
Shared services12 services7 test filesLow — encryption services, signaling, WebRTC all untested
Shared adapters5 adapters5 test filesGood — all 5 adapters covered
Shared stores4 stores3 test filesPartial — AppModeStore, SecureConfig untested
GPS feature5 hooks/services/utils0 test filesZERO
Announcements3 hooks/utils0 test filesZERO
Sync1 service + 1 API0 test filesZERO
Settings8 components/hooks0 test filesZERO
Screen components36 screens0 test filesZERO
E2E flows10 critical user journeys0 Maestro flowsZERO
Backend API80+ endpoints0 Python testsZERO

Estimated overall coverage: ~18% of business logic, 0% of UI, 0% of backend


Feature Inventory

1. Authentication

Sub-FeatureFile(s)Test FileStatusExecution Type
Server loginfeatures/auth/context/auth-context.tsxauth-context.test.tsxPartialAUTOMATED
Guest (LAN) loginauth-container.tsauth-container.test.tsPartialAUTOMATED
Registrationhooks/use-register.tsNoneMissingAUTOMATED
Forgot password — emailhooks/use-email-reset.tsNoneMissingAUTOMATED
Forgot password — SMShooks/use-sms-reset.tsNoneMissingAUTOMATED
Forgot password — security questionhooks/use-verify-question.tsuse-verify-question.test.tsPartial (attemptsRemaining only)AUTOMATED
Forgot password — recovery keyhooks/use-verify-recovery-key.tsNoneMissingAUTOMATED
Password resethooks/use-change-password.tsuse-change-password.test.tsMinimal (recovery token only)AUTOMATED
Lockout timerhooks/use-lockout-timer.tsNoneMissingAUTOMATED
Recovery key setuphooks/use-recovery-key-setup.tsNoneMissingAUTOMATED
Recovery constraintshooks/use-recovery-constraints.tsNoneMissingAUTOMATED
Email verificationhooks/use-validate-identifier.tsNoneMissingAUTOMATED
Token utilitiesutils/token-utils.tstoken-utils.test.tsGoodAUTOMATED
Form validationutils/validation.tsvalidation.test.tsPartial (guest only)AUTOMATED
Guest migrationservices/guest-migration-service.tsNoneMissingAUTOMATED
Auth APIapi/auth.api.test.tsMinimal (reset password only)AUTOMATED

2. Chat

Sub-FeatureFile(s)Test FileStatusExecution Type
ChatService (P2P)chat/services/chat-service.tschat-service.test.tsPartialAUTOMATED
PublicChatServicechat/services/public-chat-service.tsNoneMissingAUTOMATED
MessageRepositorychat/repositories/message-repository.tsmessage-repository.test.tsGoodAUTOMATED
ConversationRepositorychat/repositories/conversation-repository.tsconversation-repository.test.tsGoodAUTOMATED
ConversationParticipantRepositoryconversation-participant-repository.test.tsGoodAUTOMATED
MessageStatusRepositorymessage-status-repository.test.tsGoodAUTOMATED
ConversationKeyStoreconversation-key-store.test.tsGoodAUTOMATED
MessageReceiptManagermessage-receipt-manager.test.tsGoodAUTOMATED
ID utilitiesutils/direct-conversation-id.ts etc.NoneMissingAUTOMATED
Chat hookshooks/use-chats.ts, use-chat-service.tsNoneMissingAUTOMATED
Public chat APIapi/public-chat.api.tsNoneMissingAUTOMATED
Chat send on real P2P networkReal TCP/WebRTCNoneMissingHYBRID
Message delivery on unstable linkReal 30% packet lossNoneMissingMANUAL

3. Call

Sub-FeatureFile(s)Test FileStatusExecution Type
CallServicecall/services/call-service.tscall-service.test.tsGoodAUTOMATED
CallRepositorycall/repositories/call-repository.tsNoneMissingAUTOMATED
CallParticipantRepositoryNoneMissingAUTOMATED
CallMessageRoutershared/services/call-message-router.tscall-message-router.test.tsGoodAUTOMATED
Call contextcall/context/call-context.tsxNoneMissingAUTOMATED
Call hookscall/hooks/NoneMissingAUTOMATED
Audio call on real deviceReal mic/speakerNoneMissingMANUAL
Video call on real deviceReal cameraNoneMissingMANUAL
Call under WiFi → cellular handoverReal networkNoneMissingMANUAL
ICE reconnect on mid-call dropReal network disruptionNoneMissingHYBRID

4. Shared — Services

Sub-FeatureFile(s)Test FileStatusExecution Type
ConnectionServiceservices/connection-service.tsconnection-service.test.tsPartialAUTOMATED
DiscoveryServiceservices/discovery-service.tsdiscovery-service.test.tsGoodAUTOMATED
NotificationServiceservices/notification-service.tsnotification-service.test.tsGoodAUTOMATED
PeerServiceservices/peer-service.tspeer-service.test.tsGoodAUTOMATED
UserServiceservices/user-service.tsuser-service.test.tsGoodAUTOMATED
CleanUpServiceservices/clean-up-service.tsclean-up-service.test.tsGoodAUTOMATED
ActiveUsersServiceservices/active-users-service.tsNoneMissingAUTOMATED
SignalingServiceservices/signaling-service.tsNoneMissingAUTOMATED
WebrtcSessionManagerservices/webrtc-session-manager.tsNoneMissingAUTOMATED
CallMediaServiceservices/call-media-service.tsNoneMissingAUTOMATED

5. Shared — Encryption (all CRITICAL risk)

Sub-FeatureFile(s)Test FileStatusExecution TypeRisk
LocalEncryptionServiceservices/local-encryption-service.tsNoneMissingAUTOMATEDCRITICAL
TcpEncryptionServiceservices/tcp-encryption.tsNoneMissingAUTOMATEDCRITICAL
WsEncryptionServiceservices/ws-encryption.tsNoneMissingAUTOMATEDCRITICAL
PeerKeyServiceservices/peer-key-service.tsNoneMissingAUTOMATEDHIGH
PeerKeyStoreservices/peer-key-store.tsNoneMissingAUTOMATEDHIGH
KeyDerivationservices/key-derivation.tsNoneMissingAUTOMATEDCRITICAL
KeyRecoveryServiceservices/key-recovery-service.tsNoneMissingAUTOMATEDHIGH
At-rest data visibilityPhysical device forensicsNoneMissingMANUALCRITICAL

6. Shared — Adapters

Sub-FeatureFile(s)Test FileStatusExecution Type
TcpClientAdapteradapters/tcp-client-adapter.tstcp-client-adapter.test.tsGoodAUTOMATED
TcpServerAdapteradapters/tcp-server-adapter.tstcp-server-adapter.test.tsGoodAUTOMATED
WsSignalingAdapteradapters/ws-signaling-adapter.tsNoneMissingAUTOMATED
WebrtcAdapteradapters/webrtc-adapter.tswebrtc-adapter.test.tsPartialAUTOMATED
ZeroconfAdapteradapters/zeroconf-adapter.tszeroconf-adapter.test.tsGoodAUTOMATED
WsMessageParseradapters/ws-signaling-adapter.tsws-message-parser.test.tsGoodAUTOMATED

7. GPS Feature (zero coverage)

Sub-FeatureFile(s)Test FileStatusExecution TypeRisk
GpsLocationServicegps/services/gps-location-service.tsNoneMissingAUTOMATEDHIGH
useGpsStreaminggps/hooks/useGpsStreaming.tsNoneMissingAUTOMATEDHIGH
useLatestLocationsgps/hooks/useLatestLocations.tsNoneMissingAUTOMATEDMEDIUM
useGpsHistorygps/hooks/useGpsHistory.tsNoneMissingAUTOMATEDMEDIUM
useLocationPermissiongps/hooks/useLocationPermission.tsNoneMissingAUTOMATEDMEDIUM
haversine distancegps/utils/haversine.tsNoneMissingAUTOMATEDLOW (pure fn)
format-relative-timegps/utils/format-relative-time.tsNoneMissingAUTOMATEDLOW (pure fn)
GPS preference contextgps/components/gps-preference-context.tsxNoneMissingAUTOMATEDMEDIUM
GPS on real device (permission flow)Physical deviceNoneMissingMANUALHIGH
GPS accuracy on network-only locationNo GPS fixNoneMissingMANUALMEDIUM

8. Sync Feature (zero coverage)

Sub-FeatureFile(s)Test FileStatusExecution TypeRisk
SyncServicesync/services/sync-service.tsNoneMissingAUTOMATEDHIGH
Sync APIsync/api/sync.api.tsNoneMissingAUTOMATEDHIGH
Sync on unstable connectionReal networkNoneMissingMANUALHIGH

9. Announcements Feature (zero coverage)

Sub-FeatureFile(s)Test FileStatusExecution Type
Announcements APIannouncements/api.tsNoneMissingAUTOMATED
useAnnouncementsannouncements/hooks/use-announcements.tsNoneMissingAUTOMATED
useAnnouncementNewCountannouncements/hooks/use-announcement-new-count.tsNoneMissingAUTOMATED
format-announcement-dateannouncements/utils/format-announcement-date.tsNoneMissingAUTOMATED

10. Android Foreground Service (zero coverage)

Sub-FeatureFile(s)Test FileStatusExecution TypeRisk
Android foreground-service lifecyclehooks/use-foreground-service.tsNoneMissingAUTOMATEDHIGH
Foreground service under Android DozeReal device, battery saverNoneMissingMANUALHIGH

Screens with Zero Test Coverage

ScreenRoutePriorityExecution Type
Getting Started/getting-startedHIGHHYBRID
Server Login/auth/login/server-loginCRITICALAUTOMATED (RNTL) + HYBRID (Maestro)
LAN Login/auth/login/lan-loginCRITICALAUTOMATED (RNTL) + HYBRID (Maestro)
Register/auth/registerCRITICALHYBRID
Forgot Password (6 screens)/auth/forgot-password/*HIGHHYBRID
Chats Tab/(drawer)/(tabs)/indexCRITICALHYBRID
Chat Room/(drawer)/(tabs)/chat/[id]CRITICALHYBRID
Incoming Call/(drawer)/(tabs)/call/incomingCRITICALHYBRID + MANUAL
Call Room/(drawer)/(tabs)/call/[id]CRITICALHYBRID + MANUAL
Public Chat/(drawer)/(tabs)/public-chatHIGHHYBRID
Map/GPS/(drawer)/(tabs)/mapHIGHHYBRID + MANUAL
Settings Tab/(drawer)/(tabs)/settingsHIGHHYBRID
Search/(drawer)/searchMEDIUMHYBRID
Announcements/(drawer)/announcementsMEDIUMHYBRID
QR Scanner/(drawer)/(tabs)/scan-qrMEDIUMHYBRID + MANUAL
Peer Profile/(drawer)/(tabs)/peer/[id]LOWHYBRID
Manage Profile/settings/account/manage-profileHIGHHYBRID
Password & Security/settings/account/password-and-securityHIGHHYBRID
Change Password/settings/account/change-passwordHIGHHYBRID
Security Question/settings/account/security-questionMEDIUMHYBRID
Generate Recovery Key/settings/account/generate-recovery-keyHIGHHYBRID
QR Code/settings/account/qr-codeLOWHYBRID
Switch Mode/settings/account/switch-modeHIGHHYBRID
GPS Settings/settings/preferences/gpsMEDIUMHYBRID
Theme Settings/settings/preferences/themeLOWMANUAL
Email flows (3 screens)/settings/account/email/*MEDIUMHYBRID
Phone flows (3 screens)/settings/account/phone/*MEDIUMHYBRID

Backend — Zero Test Coverage

AreaEndpointsRiskExecution Type
Auth (login, token, refresh)9CRITICALAUTOMATED (Pytest)
Forgot password flow16HIGHAUTOMATED (Pytest)
WebSocket signaling1 WS endpointCRITICALAUTOMATED (pytest-asyncio)
Sync (pull/push)2CRITICALAUTOMATED (Pytest)
GPS WebSocket2 WS endpointsHIGHAUTOMATED (pytest-asyncio)
Keys/ECDH6HIGHAUTOMATED (Pytest)
Admin role management6HIGHAUTOMATED (Pytest)
Testing endpoints (no auth)2CRITICAL — securityAUTOMATED (Pytest)
CORS + credentials behaviorConfigHIGHMANUAL (browser + real origin)
JWT secret in productionConfigCRITICALMANUAL (env audit)

Critical Security Issues (Found During Inventory)

  1. /testing/test-make-admin and /testing/test-make-rescuer — no authentication, included in production router. Any unauthenticated request can grant admin or rescuer privileges.
  2. /gps/ws/monitor/rescuers/{rescuer_id} — GPS location monitor WebSocket has no authentication. Any client can receive all user GPS coordinates.
  3. /auth/exists — no rate limiting; enables username and email enumeration at scale.
  4. JWT secret fallback — hardcoded fallback value used when JWT_SECRET_KEY env var is not set in production.
  5. CORS fully openallow_origins=["*"] combined with allow_credentials=True is an invalid CORS configuration per spec; credentials are silently dropped by browsers.
  6. Captive portal — no authentication on any endpoint; any host on the network can create or modify guest sessions.
  7. Admin refresh uses cookie only — inconsistent with Bearer token auth used by all other admin endpoints.
  8. Server Host Override in drawer — UI text field visible to all users allows runtime override of the API base URL, enabling MITM attacks.
  9. Captive portal db NameErrordisconnect_guest_session references db but the dependency is named session; the PATCH endpoint crashes at runtime.
  10. Duplicate NAMESPACE in gsm.py — variable defined twice; the second definition silently shadows the first.