PATCH /api/membership/members/:id/avatar — admin avatar (API exists; no admin UI control yet)
Frontend: member self → /account/profile (pages/account/ProfileTab.tsx); admin full edit → /admin/members/:id/edit (pages/AdminEditMemberPage.tsx). Legacy /profile redirects to /account/profile.
Prerequisites
Member logged in (owns the profile), or ADMIN for the admin-edit cases.
Test Cases
TC-PROF-01: View Own Profile
Step
Action
Expected Result
1
Log in as Maria Cruz → sidebar My Account → Profile tab (/account/profile).
Profile loads. GET /api/membership/members/me.
2
Verify displayed data.
First/last/middle name, email, phone, address, profession/company, socials match the member record.
3
Privacy.
No sensitive fields (password hash, internal IDs) exposed.
TC-PROF-02: Update Personal Details (incl. international phone)
Step
Action
Expected Result
1
On /account/profile, edit Phone (uses the international PhoneInput — country selector + number), Address, LinkedIn.
Fields editable; "Save Changes" enables when the form is dirty.
2
Use a US/intl number (e.g. +1 202 555 0142). Click Save Changes.
PATCH .../members/me → 200. The intl phone persists (#182) on reload.
TC-PROF-03: Upload Avatar
Step
Action
Expected Result
1
On /account/profile, in the Profile Photo card click "Upload Photo". Pick a JPG/PNG.
A crop modal opens; confirm.
2
Save.
PATCH .../members/me/avatar. Toast "Profile photo updated!". The image displays immediately and persists — stored as an S3 key, not an inline data URI (#199 fix).
TC-PROF-04: Avatar Validation
Step
Action
Expected Result
1
Try an oversized image (the UI hint is "JPG or PNG, max 5MB"); also try a non-image / .svg.
Rejected. (Server also normalizes only jpeg/png/gif/webp ≤2MB; SVG is blocked — see security #127.)
TC-PROF-05: Admin Edits a Member Profile + Joined Date (#184)
Step
Action
Expected Result
1
As ADMIN, All Members → open a member → "Edit Profile" (/admin/members/:id/edit).
Full edit form loads.
2
In "Membership Information", change "Member Since (Joined Date)" (date ≤ today). Save.
PATCH .../members/:id with joinedAt. Saved; change written to the member audit log.