Why this matters now
ProfileScreen is the primary UX surface for the impact dashboard (trees planted, plastic collected, CO₂ reduced) and achievement system — both of which are listed as shipped features. It also hosts the disconnect/logout path, which clears both userStore and walletStore. EditProfileScreen is the only way to update name and bio, and it calls api.updateProfile. Neither screen has any test coverage.
Problem / What
src/screens/ProfileScreen.tsx renders ImpactStats, AchievementGrid, and a settings menu with navigation to EditProfile and NotificationPreferences. src/screens/EditProfileScreen.tsx has controlled inputs, a save handler that calls api.updateProfile, and local error state.
There are no test files for either screen. components.test.tsx does test ImpactStats in isolation, but the integration of stats display within ProfileScreen (driven by userStore.profile.stats) is untested.
Key Challenges
ProfileScreen uses useStellarWallet which has a complex mock requirement (connectAccount, disconnectWallet, Stellar service calls).
EditProfileScreen calls api.updateProfile — mock src/services/api with jest.mock.
- The
disconnectWallet + logout combined action must be tested to ensure both stores are cleared atomically.
- Achievement thresholds (already tested in
achievements.test.ts) should be verified to render correctly in ProfileScreen via AchievementGrid.
Acceptance Criteria
Relevant files / functions
src/screens/ProfileScreen.tsx
src/screens/EditProfileScreen.tsx
src/store/userStore.ts
src/store/walletStore.ts
src/services/api.ts — updateProfile
Out of scope
- Testing avatar upload (not yet implemented).
- Testing the "Language" or "About" settings rows (no-op currently).
Why this matters now
ProfileScreenis the primary UX surface for the impact dashboard (trees planted, plastic collected, CO₂ reduced) and achievement system — both of which are listed as shipped features. It also hosts the disconnect/logout path, which clears bothuserStoreandwalletStore.EditProfileScreenis the only way to updatenameandbio, and it callsapi.updateProfile. Neither screen has any test coverage.Problem / What
src/screens/ProfileScreen.tsxrendersImpactStats,AchievementGrid, and a settings menu with navigation toEditProfileandNotificationPreferences.src/screens/EditProfileScreen.tsxhas controlled inputs, a save handler that callsapi.updateProfile, and local error state.There are no test files for either screen.
components.test.tsxdoes testImpactStatsin isolation, but the integration of stats display withinProfileScreen(driven byuserStore.profile.stats) is untested.Key Challenges
ProfileScreenusesuseStellarWalletwhich has a complex mock requirement (connectAccount,disconnectWallet, Stellar service calls).EditProfileScreencallsapi.updateProfile— mocksrc/services/apiwithjest.mock.disconnectWallet+logoutcombined action must be tested to ensure both stores are cleared atomically.achievements.test.ts) should be verified to render correctly inProfileScreenviaAchievementGrid.Acceptance Criteria
ProfileScreen.test.tsx: renders name, wallet address, ImpactStats, AchievementGrid; disconnect triggers bothuseWalletStore.disconnectanduseUserStore.logout; navigation to EditProfile and NotificationPreferences works.EditProfileScreen.test.tsx: form inputs update state; save callsapi.updateProfilewith the correct payload; success updatesuserStore.profile; error state is displayed on API failure.Relevant files / functions
src/screens/ProfileScreen.tsxsrc/screens/EditProfileScreen.tsxsrc/store/userStore.tssrc/store/walletStore.tssrc/services/api.ts—updateProfileOut of scope