Skip to content

test: cover mobile service layer and sync queue#207

Open
brentthomas248 wants to merge 1 commit into
ChainForgee:mainfrom
brentthomas248:codex/grantfox-chainforge-104
Open

test: cover mobile service layer and sync queue#207
brentthomas248 wants to merge 1 commit into
ChainForgee:mainfrom
brentthomas248:codex/grantfox-chainforge-104

Conversation

@brentthomas248

Copy link
Copy Markdown

Summary

  • Add mocked-fetch coverage for the mobile aid API service, including list/detail reads, claim submission headers, and error statuses.
  • Add AsyncStorage-backed aid cache tests for empty cache, persistence, timestamp writes, and invalidation.
  • Add offline sync queue network tests for offline queueing, online flush, retryable failures, persisted errors, and saver-mode flush limits.

Closes #104

Verification

  • PASS: npm test -- --runInBand src/__tests__/api.test.ts src/__tests__/claimSubmissionQueue.test.tsx src/__tests__/aidApi.test.ts src/__tests__/aidCache.test.ts src/__tests__/syncQueueNetwork.test.ts (5 suites, 33 tests)
  • PASS: npx eslint src/__tests__/aidApi.test.ts src/__tests__/aidCache.test.ts src/__tests__/syncQueueNetwork.test.ts (only existing Node module-type warning from eslint.config.js)
  • PASS: git diff --check

Existing Baseline Failures Not Introduced Here

  • npm test -- --runInBand currently fails existing suites: navigation.test.tsx, screens.test.tsx, HomeScreen.test.tsx, and ScannerScreen.test.tsx (ExpoBarCodeScanner native module missing in Jest setup, theme provider/test harness errors). The new service/cache/sync tests pass in the full run.
  • npm run lint currently fails on an existing ReleaseNotesModal.tsx react/no-unescaped-entities error plus existing warnings outside this patch.
  • npx tsc --noEmit --project tsconfig.json currently fails on existing AsyncStorage.clear typing in claimSubmissionQueue.test.tsx and existing theme/accessibility type errors in AidDetailsScreen.tsx / ClaimReceiptScreen.tsx.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[MEDIUM] Add mobile service layer and offline sync tests

1 participant