# 1. Personal Information Management — Test Cases

User Type: **Student**
Source: *Mi Digital Academy - Education CRM Features Document*
Spec: personal_information.md — every feature, sub-feature, and rule covered

---

## Test Execution Policy
- Zero tolerance: any deviation from documented behavior = FAILED = bug
- Every bug is immediately logged/reported (Bug ID, feature, sub-feature, expected vs actual, severity) and fixed 100% before the group passes
- Feature group passes only at 100% test pass rate

## Coverage Matrix
| Feature | Sub-feature / Rule | Test IDs |
|---------|--------------------|----------|
| 1.1 View and Edit Personal Information | Profile view: all personal information displayed in a read-only summary | TC-ST-02-01-001 |
| 1.1 View and Edit Personal Information | Edit full name with length and character validation | TC-ST-02-01-002 |
| 1.1 View and Edit Personal Information | Edit date of birth with date validation (must be a real, past date) | TC-ST-02-01-003 |
| 1.1 View and Edit Personal Information | Edit gender (optional field) | TC-ST-02-01-004 |
| 1.1 View and Edit Personal Information | Upload and replace profile photo (format and size validation, cropping) | TC-ST-02-01-005 |
| 1.1 View and Edit Personal Information | Edit phone number with format validation; triggers re-verification | TC-ST-02-01-006 |
| 1.1 View and Edit Personal Information | Edit email address with format validation; triggers re-verification | TC-ST-02-01-007 |
| 1.1 View and Edit Personal Information | Edit city, province, and school name (optional fields) | TC-ST-02-01-008 |
| 1.1 View and Edit Personal Information | Save with a single "Save changes" action and a success confirmation | TC-ST-02-01-009 |
| 1.1 View and Edit Personal Information | Change history: a record of what was changed and when | TC-ST-02-01-010 |
| 1.1 View and Edit Personal Information | Audit logging of the personal information changes | TC-ST-02-01-011 |
| 1.1 View and Edit Personal Information | Rule: Date of birth must be a real, past date; future or invalid dates are rejected. | TC-ST-02-01-001 |
| 1.1 View and Edit Personal Information | Rule: Changing the email or phone triggers re-verification; the old value stays active until the new one is verified. | TC-ST-02-01-002 |
| 1.1 View and Edit Personal Information | Rule: The profile photo must meet the format and size limits; oversized or unsupported files are rejected with a clear message. | TC-ST-02-01-003 |
| 1.1 View and Edit Personal Information | Rule: Required fields (name, date of birth) cannot be left blank. | TC-ST-02-01-004 |
| 1.1 View and Edit Personal Information | Rule: Every change is recorded in the change history with the field, old value, new value, and timestamp. | TC-ST-02-01-005 |
| 1.1 View and Edit Personal Information | Rule: The personal information changes are audit-logged with the account, the fields changed, and the timestamp. | TC-ST-02-01-006 |
| 1.2 Profile Photo Management | Upload a profile photo (accepted formats: JPG, PNG; size limit) | TC-ST-02-01-012 |
| 1.2 Profile Photo Management | Client-side cropping to a square aspect ratio before upload | TC-ST-02-01-013 |
| 1.2 Profile Photo Management | Replace the existing photo at any time | TC-ST-02-01-014 |
| 1.2 Profile Photo Management | Remove the photo to revert to an initial-based avatar | TC-ST-02-01-015 |
| 1.2 Profile Photo Management | Photo displayed across the platform (dashboard, social learning, live sessions) | TC-ST-02-01-016 |
| 1.2 Profile Photo Management | Format and size validation with clear error messages | TC-ST-02-01-017 |
| 1.2 Profile Photo Management | Photo storage and delivery optimized for display (compressed thumbnails) | TC-ST-02-01-018 |
| 1.2 Profile Photo Management | Photo change event logging | TC-ST-02-01-019 |
| 1.2 Profile Photo Management | Audit logging of the profile photo management | TC-ST-02-01-020 |
| 1.2 Profile Photo Management | Rule: Only JPG and PNG are accepted; other formats are rejected with a clear message. | TC-ST-02-01-012 |
| 1.2 Profile Photo Management | Rule: The photo must be within the size limit; oversized files are rejected before upload. | TC-ST-02-01-013 |
| 1.2 Profile Photo Management | Rule: The photo is cropped to a square aspect ratio; the original aspect is not preserved. | TC-ST-02-01-014 |
| 1.2 Profile Photo Management | Rule: Removing the photo reverts to an initial-based avatar; it does not delete the account. | TC-ST-02-01-015 |
| 1.2 Profile Photo Management | Rule: Photo changes (upload, replace, remove) are logged with timestamp. | TC-ST-02-01-016 |
| 1.2 Profile Photo Management | Rule: The profile photo management is audit-logged with the account, the action, and the timestamp. | TC-ST-02-01-017 |
| 1.3 Contact Information Verification | Re-verify current email on demand (sends a fresh verification link) | TC-ST-02-01-021 |
| 1.3 Contact Information Verification | Re-verify current phone on demand (sends a fresh OTP) | TC-ST-02-01-022 |
| 1.3 Contact Information Verification | New email verification flow (link, single-use, time-limited) | TC-ST-02-01-023 |
| 1.3 Contact Information Verification | New phone verification flow (OTP, single-use, time-limited) | TC-ST-02-01-024 |
| 1.3 Contact Information Verification | Old contact value remains active until the new one is verified | TC-ST-02-01-025 |
| 1.3 Contact Information Verification | Verification status indicator (verified, pending verification) | TC-ST-02-01-026 |
| 1.3 Contact Information Verification | Resend verification with rate limiting | TC-ST-02-01-027 |
| 1.3 Contact Information Verification | Expired-verification handling with a reissue option | TC-ST-02-01-028 |
| 1.3 Contact Information Verification | Verification event logging (sent, verified, expired, failed) | TC-ST-02-01-029 |
| 1.3 Contact Information Verification | Audit logging of the contact information verification | TC-ST-02-01-030 |
| 1.3 Contact Information Verification | Rule: The old contact value remains active until the new one is verified; there is never a gap in a verified contact. | TC-ST-02-01-021 |
| 1.3 Contact Information Verification | Rule: Verification links and OTPs are single-use and time-limited; expiry produces a reissue path. | TC-ST-02-01-022 |
| 1.3 Contact Information Verification | Rule: Resends are rate-limited to prevent abuse. | TC-ST-02-01-023 |
| 1.3 Contact Information Verification | Rule: A "Pending verification" badge is shown on any contact value that is not yet verified. | TC-ST-02-01-024 |
| 1.3 Contact Information Verification | Rule: Verification events (sent, verified, expired, failed) are logged with timestamp and channel. | TC-ST-02-01-025 |
| 1.3 Contact Information Verification | Rule: The contact information verification is audit-logged with the account, the channel, and the timestamp. | TC-ST-02-01-026 |

## 1.1 View and Edit Personal Information

### TC-ST-02-01-001 — Profile view: all personal information displayed in a read-only summary
**Type:** Positive
**Covers:** 1.1 → Profile view: all personal information displayed in a read-only summary; Rule: Date of birth must be a real, past date; future or invalid dates are rejected.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Profile view: all personal information displayed in a read-only summary.
2. Observe the result and verify the full behavior: Profile view: all personal information displayed in a read-only summary.
**Expected Result:** Profile view: all personal information displayed in a read-only summary — delivered exactly as documented.
**Priority:** Critical

### TC-ST-02-01-002 — Edit full name with length and character validation
**Type:** Edge
**Covers:** 1.1 → Edit full name with length and character validation; Rule: Changing the email or phone triggers re-verification; the old value stays active until the new one is verified.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Edit full name with length and character validation.
2. Observe the result and verify the full behavior: Edit full name with length and character validation.
**Expected Result:** Edit full name with length and character validation — delivered exactly as documented.
**Priority:** High

### TC-ST-02-01-003 — Edit date of birth with date validation (must be a real, past date)
**Type:** Edge
**Covers:** 1.1 → Edit date of birth with date validation (must be a real, past date); Rule: The profile photo must meet the format and size limits; oversized or unsupported files are rejected with a clear message.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Edit date of birth with date validation (must be a real.
2. Observe the result and verify the full behavior: Edit date of birth with date validation (must be a real, past date).
**Expected Result:** Edit date of birth with date validation (must be a real, past date) — delivered exactly as documented.
**Priority:** High

### TC-ST-02-01-004 — Edit gender (optional field)
**Type:** Positive
**Covers:** 1.1 → Edit gender (optional field); Rule: Required fields (name, date of birth) cannot be left blank.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Edit gender (optional field).
2. Observe the result and verify the full behavior: Edit gender (optional field).
**Expected Result:** Edit gender (optional field) — delivered exactly as documented.
**Priority:** High

### TC-ST-02-01-005 — Upload and replace profile photo (format and size validation, cropping)
**Type:** Edge
**Covers:** 1.1 → Upload and replace profile photo (format and size validation, cropping); Rule: Every change is recorded in the change history with the field, old value, new value, and timestamp.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Upload and replace profile photo (format and size validation.
2. Observe the result and verify the full behavior: Upload and replace profile photo (format and size validation, cropping).
**Expected Result:** Upload and replace profile photo (format and size validation, cropping) — delivered exactly as documented.
**Priority:** High

### TC-ST-02-01-006 — Edit phone number with format validation; triggers re-verification
**Type:** Edge
**Covers:** 1.1 → Edit phone number with format validation; triggers re-verification; Rule: The personal information changes are audit-logged with the account, the fields changed, and the timestamp.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Edit phone number with format validation; triggers re-verification.
2. Observe the result and verify the full behavior: Edit phone number with format validation; triggers re-verification.
**Expected Result:** Edit phone number with format validation; triggers re-verification — delivered exactly as documented.
**Priority:** High

### TC-ST-02-01-007 — Edit email address with format validation; triggers re-verification
**Type:** Edge
**Covers:** 1.1 → Edit email address with format validation; triggers re-verification
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Edit email address with format validation; triggers re-verification.
2. Observe the result and verify the full behavior: Edit email address with format validation; triggers re-verification.
**Expected Result:** Edit email address with format validation; triggers re-verification — delivered exactly as documented.
**Priority:** High

### TC-ST-02-01-008 — Edit city, province, and school name (optional fields)
**Type:** Positive
**Covers:** 1.1 → Edit city, province, and school name (optional fields)
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Edit city.
2. Observe the result and verify the full behavior: Edit city, province, and school name (optional fields).
**Expected Result:** Edit city, province, and school name (optional fields) — delivered exactly as documented.
**Priority:** High

### TC-ST-02-01-009 — Save with a single "Save changes" action and a success confirmation
**Type:** Positive
**Covers:** 1.1 → Save with a single "Save changes" action and a success confirmation
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Save with a single "Save changes" action and a success confirmation.
2. Observe the result and verify the full behavior: Save with a single "Save changes" action and a success confirmation.
**Expected Result:** Save with a single "Save changes" action and a success confirmation — delivered exactly as documented.
**Priority:** High

### TC-ST-02-01-010 — Change history: a record of what was changed and when
**Type:** Positive
**Covers:** 1.1 → Change history: a record of what was changed and when
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Change history: a record of what was changed and when.
2. Observe the result and verify the full behavior: Change history: a record of what was changed and when.
**Expected Result:** Change history: a record of what was changed and when — delivered exactly as documented.
**Priority:** High

### TC-ST-02-01-011 — Audit logging of the personal information changes
**Type:** Positive
**Covers:** 1.1 → Audit logging of the personal information changes
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, perform the action associated with: Audit logging of the personal information changes.
2. Open the relevant activity / audit log and verify the event is recorded with the account, the action, and the timestamp.
**Expected Result:** The action is audit-logged — the account, the action, and the timestamp are recorded.
**Priority:** Critical

## 1.2 Profile Photo Management

### TC-ST-02-01-012 — Upload a profile photo (accepted formats: JPG, PNG; size limit)
**Type:** Edge
**Covers:** 1.2 → Upload a profile photo (accepted formats: JPG, PNG; size limit); Rule: Only JPG and PNG are accepted; other formats are rejected with a clear message.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Upload a profile photo (accepted formats: JPG.
2. Observe the result and verify the full behavior: Upload a profile photo (accepted formats: JPG, PNG; size limit).
**Expected Result:** Upload a profile photo (accepted formats: JPG, PNG; size limit) — delivered exactly as documented.
**Priority:** Critical

### TC-ST-02-01-013 — Client-side cropping to a square aspect ratio before upload
**Type:** Positive
**Covers:** 1.2 → Client-side cropping to a square aspect ratio before upload; Rule: The photo must be within the size limit; oversized files are rejected before upload.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Client-side cropping to a square aspect ratio before upload.
2. Observe the result and verify the full behavior: Client-side cropping to a square aspect ratio before upload.
**Expected Result:** Client-side cropping to a square aspect ratio before upload — delivered exactly as documented.
**Priority:** High

### TC-ST-02-01-014 — Replace the existing photo at any time
**Type:** Positive
**Covers:** 1.2 → Replace the existing photo at any time; Rule: The photo is cropped to a square aspect ratio; the original aspect is not preserved.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Replace the existing photo at any time.
2. Observe the result and verify the full behavior: Replace the existing photo at any time.
**Expected Result:** Replace the existing photo at any time — delivered exactly as documented.
**Priority:** High

### TC-ST-02-01-015 — Remove the photo to revert to an initial-based avatar
**Type:** Positive
**Covers:** 1.2 → Remove the photo to revert to an initial-based avatar; Rule: Removing the photo reverts to an initial-based avatar; it does not delete the account.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Remove the photo to revert to an initial-based avatar.
2. Observe the result and verify the full behavior: Remove the photo to revert to an initial-based avatar.
**Expected Result:** Remove the photo to revert to an initial-based avatar — delivered exactly as documented.
**Priority:** High

### TC-ST-02-01-016 — Photo displayed across the platform (dashboard, social learning, live sessions)
**Type:** Positive
**Covers:** 1.2 → Photo displayed across the platform (dashboard, social learning, live sessions); Rule: Photo changes (upload, replace, remove) are logged with timestamp.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Photo displayed across the platform (dashboard.
2. Observe the result and verify the full behavior: Photo displayed across the platform (dashboard, social learning, live sessions).
**Expected Result:** Photo displayed across the platform (dashboard, social learning, live sessions) — delivered exactly as documented.
**Priority:** High

### TC-ST-02-01-017 — Format and size validation with clear error messages
**Type:** Edge
**Covers:** 1.2 → Format and size validation with clear error messages; Rule: The profile photo management is audit-logged with the account, the action, and the timestamp.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Format and size validation with clear error messages.
2. Observe the result and verify the full behavior: Format and size validation with clear error messages.
**Expected Result:** Format and size validation with clear error messages — delivered exactly as documented.
**Priority:** High

### TC-ST-02-01-018 — Photo storage and delivery optimized for display (compressed thumbnails)
**Type:** Positive
**Covers:** 1.2 → Photo storage and delivery optimized for display (compressed thumbnails)
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Photo storage and delivery optimized for display (compressed thumbnails).
2. Observe the result and verify the full behavior: Photo storage and delivery optimized for display (compressed thumbnails).
**Expected Result:** Photo storage and delivery optimized for display (compressed thumbnails) — delivered exactly as documented.
**Priority:** High

### TC-ST-02-01-019 — Photo change event logging
**Type:** Positive
**Covers:** 1.2 → Photo change event logging
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Photo change event logging.
2. Observe the result and verify the full behavior: Photo change event logging.
**Expected Result:** Photo change event logging — delivered exactly as documented.
**Priority:** High

### TC-ST-02-01-020 — Audit logging of the profile photo management
**Type:** Positive
**Covers:** 1.2 → Audit logging of the profile photo management
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, perform the action associated with: Audit logging of the profile photo management.
2. Open the relevant activity / audit log and verify the event is recorded with the account, the action, and the timestamp.
**Expected Result:** The action is audit-logged — the account, the action, and the timestamp are recorded.
**Priority:** Critical

## 1.3 Contact Information Verification

### TC-ST-02-01-021 — Re-verify current email on demand (sends a fresh verification link)
**Type:** Positive
**Covers:** 1.3 → Re-verify current email on demand (sends a fresh verification link); Rule: The old contact value remains active until the new one is verified; there is never a gap in a verified contact.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Re-verify current email on demand (sends a fresh verification link).
2. Observe the result and verify the full behavior: Re-verify current email on demand (sends a fresh verification link).
**Expected Result:** Re-verify current email on demand (sends a fresh verification link) — delivered exactly as documented.
**Priority:** Critical

### TC-ST-02-01-022 — Re-verify current phone on demand (sends a fresh OTP)
**Type:** Positive
**Covers:** 1.3 → Re-verify current phone on demand (sends a fresh OTP); Rule: Verification links and OTPs are single-use and time-limited; expiry produces a reissue path.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Re-verify current phone on demand (sends a fresh OTP).
2. Observe the result and verify the full behavior: Re-verify current phone on demand (sends a fresh OTP).
**Expected Result:** Re-verify current phone on demand (sends a fresh OTP) — delivered exactly as documented.
**Priority:** High

### TC-ST-02-01-023 — New email verification flow (link, single-use, time-limited)
**Type:** Edge
**Covers:** 1.3 → New email verification flow (link, single-use, time-limited); Rule: Resends are rate-limited to prevent abuse.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: New email verification flow (link.
2. Observe the result and verify the full behavior: New email verification flow (link, single-use, time-limited).
**Expected Result:** New email verification flow (link, single-use, time-limited) — delivered exactly as documented.
**Priority:** High

### TC-ST-02-01-024 — New phone verification flow (OTP, single-use, time-limited)
**Type:** Edge
**Covers:** 1.3 → New phone verification flow (OTP, single-use, time-limited); Rule: A "Pending verification" badge is shown on any contact value that is not yet verified.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: New phone verification flow (OTP.
2. Observe the result and verify the full behavior: New phone verification flow (OTP, single-use, time-limited).
**Expected Result:** New phone verification flow (OTP, single-use, time-limited) — delivered exactly as documented.
**Priority:** High

### TC-ST-02-01-025 — Old contact value remains active until the new one is verified
**Type:** Positive
**Covers:** 1.3 → Old contact value remains active until the new one is verified; Rule: Verification events (sent, verified, expired, failed) are logged with timestamp and channel.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Old contact value remains active until the new one is verified.
2. Observe the result and verify the full behavior: Old contact value remains active until the new one is verified.
**Expected Result:** Old contact value remains active until the new one is verified — delivered exactly as documented.
**Priority:** High

### TC-ST-02-01-026 — Verification status indicator (verified, pending verification)
**Type:** Positive
**Covers:** 1.3 → Verification status indicator (verified, pending verification); Rule: The contact information verification is audit-logged with the account, the channel, and the timestamp.
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Verification status indicator (verified.
2. Observe the result and verify the full behavior: Verification status indicator (verified, pending verification).
**Expected Result:** Verification status indicator (verified, pending verification) — delivered exactly as documented.
**Priority:** High

### TC-ST-02-01-027 — Resend verification with rate limiting
**Type:** Edge
**Covers:** 1.3 → Resend verification with rate limiting
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Resend verification with rate limiting.
2. Observe the result and verify the full behavior: Resend verification with rate limiting.
**Expected Result:** Resend verification with rate limiting — delivered exactly as documented.
**Priority:** High

### TC-ST-02-01-028 — Expired-verification handling with a reissue option
**Type:** Edge
**Covers:** 1.3 → Expired-verification handling with a reissue option
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Expired-verification handling with a reissue option.
2. Observe the result and verify the full behavior: Expired-verification handling with a reissue option.
**Expected Result:** Expired-verification handling with a reissue option — delivered exactly as documented.
**Priority:** High

### TC-ST-02-01-029 — Verification event logging (sent, verified, expired, failed)
**Type:** Edge
**Covers:** 1.3 → Verification event logging (sent, verified, expired, failed)
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, set up the precondition and perform: Verification event logging (sent.
2. Observe the result and verify the full behavior: Verification event logging (sent, verified, expired, failed).
**Expected Result:** Verification event logging (sent, verified, expired, failed) — delivered exactly as documented.
**Priority:** High

### TC-ST-02-01-030 — Audit logging of the contact information verification
**Type:** Positive
**Covers:** 1.3 → Audit logging of the contact information verification
**Preconditions:** A Student account is active and the Student is in the state required for this behavior.
**Steps:**
1. As a Student, perform the action associated with: Audit logging of the contact information verification.
2. Open the relevant activity / audit log and verify the event is recorded with the account, the action, and the timestamp.
**Expected Result:** The action is audit-logged — the account, the action, and the timestamp are recorded.
**Priority:** Critical
