# 4. Content Editing & Versioning — Test Cases

User Type: **Super Administrator**
Source: *Mi Digital Academy - Education CRM Features Document*
Spec: content_editing_versioning.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 |
|---------|--------------------|----------|
| 4.1 Edit Content Metadata | Metadata fields: title, description, topic, subject, difficulty, completion time, tags | TC-SA-07-04-001 |
| 4.1 Edit Content Metadata | Edit in place: the metadata updated without re-uploading the media | TC-SA-07-04-002 |
| 4.1 Edit Content Metadata | Validation: the metadata fields checked (required fields, valid values) | TC-SA-07-04-003 |
| 4.1 Edit Content Metadata | Immediate effect: the updated metadata reflected where the content is shown | TC-SA-07-04-004 |
| 4.1 Edit Content Metadata | Edit history: the metadata changes tracked (what changed, when) | TC-SA-07-04-005 |
| 4.1 Edit Content Metadata | Bulk metadata correction: correcting a common error across multiple items | TC-SA-07-04-006 |
| 4.1 Edit Content Metadata | Audit logging of metadata edits | TC-SA-07-04-007 |
| 4.1 Edit Content Metadata | Rule: metadata edits change the descriptive/organizational attributes, not the media; no re-upload is needed | TC-SA-07-04-002 |
| 4.1 Edit Content Metadata | Rule: the fields are validated (required present, values valid); an invalid edit is rejected with the reason | TC-SA-07-04-003 |
| 4.1 Edit Content Metadata | Rule: the update takes effect immediately where the content is shown; there is no stale presentation | TC-SA-07-04-004 |
| 4.1 Edit Content Metadata | Rule: a bulk correction fixes a common error across a set; the scope of the bulk change is explicit | TC-SA-07-04-006 |
| 4.1 Edit Content Metadata | Rule: the edit history tracks the changes (what, when); the content's evolution is auditable | TC-SA-07-04-005 |
| 4.1 Edit Content Metadata | Rule: metadata edits are audit-logged with the content, fields, and timestamp | TC-SA-07-04-007 |
| 4.2 Maintain Content Version History | Version creation: a new version recorded when the content changes significantly | TC-SA-07-04-008 |
| 4.2 Maintain Content Version History | Version record: the version's content, the change, the actor, and the timestamp | TC-SA-07-04-009 |
| 4.2 Maintain Content Version History | Version list: the versions of a content item in order | TC-SA-07-04-010 |
| 4.2 Maintain Content Version History | Version comparison: reviewing what changed between versions | TC-SA-07-04-011 |
| 4.2 Maintain Content Version History | Restore: reverting a content item to a prior version | TC-SA-07-04-012 |
| 4.2 Maintain Content Version History | Version retention: the history retained per the platform's policy | TC-SA-07-04-013 |
| 4.2 Maintain Content Version History | Audit logging of version create/restore | TC-SA-07-04-014 |
| 4.2 Maintain Content Version History | Rule: a version is recorded on a significant change; the version captures the change, the actor, and the timestamp | TC-SA-07-04-009 |
| 4.2 Maintain Content Version History | Rule: a restore reverts to a prior version but is itself recorded (the history is append-only, not destroyed) | TC-SA-07-04-012 |
| 4.2 Maintain Content Version History | Rule: the version list shows the history in order; the current state is the latest version | TC-SA-07-04-010 |
| 4.2 Maintain Content Version History | Rule: version comparison shows what changed between versions; it supports a confident restore | TC-SA-07-04-011 |
| 4.2 Maintain Content Version History | Rule: the retention is per the platform's policy; older versions are available for the retention period | TC-SA-07-04-013 |
| 4.2 Maintain Content Version History | Rule: version create/restore is audit-logged with the content, version, and timestamp | TC-SA-07-04-014 |
| 4.3 Replace or Update Content | Content replacement: a new media version swapped in for the content item | TC-SA-07-04-015 |
| 4.3 Replace or Update Content | In-place update: the content updated without changing its identity/placement | TC-SA-07-04-016 |
| 4.3 Replace or Update Content | Version linkage: the replacement recorded as a new version (the prior preserved) | TC-SA-07-04-017 |
| 4.3 Replace or Update Content | Learner impact: learners mid-consumption handled (their progress on the prior version) | TC-SA-07-04-018 |
| 4.3 Replace or Update Content | Replacement validation: the new media validated (format, quality) before it goes live | TC-SA-07-04-019 |
| 4.3 Replace or Update Content | Rollback: reverting to the prior version if the replacement is faulty | TC-SA-07-04-020 |
| 4.3 Replace or Update Content | Audit logging of replacement/update | TC-SA-07-04-021 |
| 4.3 Replace or Update Content | Rule: a replacement swaps in new media; it is validated (format, quality) before going live | TC-SA-07-04-019 |
| 4.3 Replace or Update Content | Rule: the replacement is recorded as a new version; the prior version is preserved (not destroyed) | TC-SA-07-04-017 |
| 4.3 Replace or Update Content | Rule: the learner impact is handled explicitly (progress carried over or reset); it is not silently dropped | TC-SA-07-04-018 |
| 4.3 Replace or Update Content | Rule: a rollback reverts to the prior version if the replacement is faulty; the rollback is recorded | TC-SA-07-04-020 |
| 4.3 Replace or Update Content | Rule: the replacement keeps the content's identity and placement; only the media/content changes | TC-SA-07-04-016 |
| 4.3 Replace or Update Content | Rule: replacement/update is audit-logged with the content, version, impact handling, and timestamp | TC-SA-07-04-021 |

## 4.1 Edit Content Metadata

### TC-SA-07-04-001 — Metadata fields: title, description, topic, subject, difficulty, completion time, tags
**Type:** Positive
**Covers:** 4.1 → Metadata fields: title, description, topic, subject, difficulty, completion time, tags
**Preconditions:** A content item exists with metadata.
**Steps:**
1. Edit the metadata fields: title, description, topic, subject, difficulty, completion time, tags.
2. Save and verify each field is updated.
**Expected Result:** The metadata fields (title, description, topic, subject, difficulty, completion time, tags) are editable and updated.
**Priority:** Critical

### TC-SA-07-04-002 — Edit in place: the metadata updated without re-uploading the media; no re-upload is needed
**Type:** Positive
**Covers:** 4.1 → Edit in place: the metadata updated without re-uploading the media; Rule: metadata edits change the descriptive/organizational attributes, not the media; no re-upload is needed
**Preconditions:** A content item exists with media uploaded.
**Steps:**
1. Edit the metadata (e.g., a clear, learner-facing title and description).
2. Save and verify the metadata is updated without re-uploading the media.
3. Verify the underlying media is unchanged.
**Expected Result:** The metadata is updated in place — no re-upload of the media is needed.
**Priority:** High

### TC-SA-07-04-003 — Validation: the metadata fields checked (required fields, valid values); an invalid edit is rejected with the reason
**Type:** Negative
**Covers:** 4.1 → Validation: the metadata fields checked (required fields, valid values); Rule: the fields are validated (required present, values valid); an invalid edit is rejected with the reason
**Preconditions:** A content item's metadata is being edited; a required field is left blank (or an invalid value is entered).
**Steps:**
1. Attempt to save the metadata with a missing required field (or invalid value).
2. Verify the validation rejects the edit with the reason.
3. Correct the field and verify the save succeeds.
**Expected Result:** The metadata fields are validated — an invalid edit is rejected with the reason.
**Priority:** Critical

### TC-SA-07-04-004 — Immediate effect: the updated metadata reflected where the content is shown; there is no stale presentation
**Type:** Positive
**Covers:** 4.1 → Immediate effect: the updated metadata reflected where the content is shown; Rule: the update takes effect immediately where the content is shown; there is no stale presentation
**Preconditions:** A content item's metadata is updated.
**Steps:**
1. Update the metadata (e.g., the title).
2. Verify the updated metadata is reflected where the content is shown (the learner's view).
3. Verify there is no stale presentation.
**Expected Result:** The updated metadata takes effect immediately where the content is shown — there is no stale presentation.
**Priority:** High

### TC-SA-07-04-005 — Edit history: the metadata changes tracked (what changed, when); the content's evolution is auditable
**Type:** Positive
**Covers:** 4.1 → Edit history: the metadata changes tracked (what changed, when); Rule: the edit history tracks the changes (what, when); the content's evolution is auditable
**Preconditions:** A content item's metadata has been edited multiple times.
**Steps:**
1. Open the edit history for the content item.
2. Verify the metadata changes are tracked (what changed, when).
3. Verify the content's evolution is auditable.
**Expected Result:** The edit history tracks the changes (what, when) — the content's evolution is auditable.
**Priority:** High

### TC-SA-07-04-006 — Bulk metadata correction: correcting a common error across multiple items; the scope of the bulk change is explicit
**Type:** Positive
**Covers:** 4.1 → Bulk metadata correction: correcting a common error across multiple items; Rule: a bulk correction fixes a common error across a set; the scope of the bulk change is explicit
**Preconditions:** A common error exists across several items (a wrong topic tag on a batch).
**Steps:**
1. Run a bulk metadata correction, fixing the set at once.
2. Verify the common error is corrected across the set.
3. Verify the scope of the bulk change is explicit.
**Expected Result:** The bulk correction fixes the common error across the set — the scope of the bulk change is explicit.
**Priority:** High

### TC-SA-07-04-007 — Metadata edits are audit-logged with the content, fields, and timestamp
**Type:** Positive
**Covers:** 4.1 → Audit logging of metadata edits; Rule: metadata edits are audit-logged with the content, fields, and timestamp
**Preconditions:** Metadata edits have occurred.
**Steps:**
1. Open the audit trail and filter by "metadata edit".
2. Verify entries show the content, the fields changed, and the timestamp.
**Expected Result:** The metadata edits are audit-logged with the content, fields, and timestamp.
**Priority:** Critical

## 4.2 Maintain Content Version History

### TC-SA-07-04-008 — Version creation: a new version recorded when the content changes significantly
**Type:** Positive
**Covers:** 4.2 → Version creation: a new version recorded when the content changes significantly
**Preconditions:** A content item is updated (a revised lesson).
**Steps:**
1. Save the significant change to the content item.
2. Verify the platform records a new version.
**Expected Result:** A new version is recorded when the content changes significantly.
**Priority:** Critical

### TC-SA-07-04-009 — Version record: the version's content, the change, the actor, and the timestamp
**Type:** Positive
**Covers:** 4.2 → Version record: the version's content, the change, the actor, and the timestamp; Rule: a version is recorded on a significant change; the version captures the change, the actor, and the timestamp
**Preconditions:** A new version has been recorded for a content item.
**Steps:**
1. Open the version record.
2. Verify it shows the version's content, the change, the actor, and the timestamp.
**Expected Result:** The version record captures the change, the actor, and the timestamp.
**Priority:** High

### TC-SA-07-04-010 — Version list: the versions of a content item in order; the current state is the latest version
**Type:** Positive
**Covers:** 4.2 → Version list: the versions of a content item in order; Rule: the version list shows the history in order; the current state is the latest version
**Preconditions:** A content item has multiple versions.
**Steps:**
1. Open the version list for the content item.
2. Verify the versions are shown in order.
3. Verify the current state is the latest version.
**Expected Result:** The version list shows the history in order — the current state is the latest version.
**Priority:** High

### TC-SA-07-04-011 — Version comparison: reviewing what changed between versions; it supports a confident restore
**Type:** Positive
**Covers:** 4.2 → Version comparison: reviewing what changed between versions; Rule: version comparison shows what changed between versions; it supports a confident restore
**Preconditions:** A content item has a current version and a prior version (the current introduced an error).
**Steps:**
1. Compare the versions (what changed between the current and the prior).
2. Verify the comparison shows what changed.
3. Verify it supports a confident restore.
**Expected Result:** The version comparison shows what changed between versions — it supports a confident restore.
**Priority:** High

### TC-SA-07-04-012 — Restore: reverting a content item to a prior version; the restore is itself recorded (the history is append-only, not destroyed)
**Type:** Positive
**Covers:** 4.2 → Restore: reverting a content item to a prior version; Rule: a restore reverts to a prior version but is itself recorded (the history is append-only, not destroyed)
**Preconditions:** A content item has a prior version; the current version has an error.
**Steps:**
1. Restore the content item to the prior version.
2. Verify the content reverts to the prior version.
3. Verify the restore is recorded as a new version (the history is not destroyed).
**Expected Result:** The restore reverts to the prior version — it is itself recorded (the history is append-only, not destroyed).
**Priority:** Critical

### TC-SA-07-04-013 — Version retention: the history retained per the platform's policy; older versions are available for the retention period
**Type:** Edge
**Covers:** 4.2 → Version retention: the history retained per the platform's policy; Rule: the retention is per the platform's policy; older versions are available for the retention period
**Preconditions:** A content item has a long history; the platform's retention policy is configured.
**Steps:**
1. Review the version retention.
2. Verify the history is retained per the platform's policy.
3. Verify the older versions are available for the retention period.
**Expected Result:** The version history is retained per the platform's policy — older versions are available for the retention period.
**Priority:** Medium

### TC-SA-07-04-014 — Version create/restore is audit-logged with the content, version, and timestamp
**Type:** Positive
**Covers:** 4.2 → Audit logging of version create/restore; Rule: version create/restore is audit-logged with the content, version, and timestamp
**Preconditions:** Versions have been created and restored.
**Steps:**
1. Open the audit trail and filter by "version".
2. Verify entries for create and restore show the content, the version, and the timestamp.
**Expected Result:** The version create and restore events are audit-logged with the content, version, and timestamp.
**Priority:** Critical

## 4.3 Replace or Update Content

### TC-SA-07-04-015 — Content replacement: a new media version swapped in for the content item
**Type:** Positive
**Covers:** 4.3 → Content replacement: a new media version swapped in for the content item
**Preconditions:** A video needs a correction (an error in the lesson); a re-recorded version is prepared.
**Steps:**
1. Initiate the replacement with the re-recorded version.
2. Verify the new media version is swapped in for the content item.
3. Verify learners now see the corrected material.
**Expected Result:** The new media version is swapped in for the content item — learners see the corrected material.
**Priority:** Critical

### TC-SA-07-04-016 — In-place update: the content updated without changing its identity/placement; only the media/content changes
**Type:** Positive
**Covers:** 4.3 → In-place update: the content updated without changing its identity/placement; Rule: the replacement keeps the content's identity and placement; only the media/content changes
**Preconditions:** A content item is replaced/updated.
**Steps:**
1. Replace the content item's media.
2. Verify the content's identity and placement are unchanged.
3. Verify only the media/content changed.
**Expected Result:** The replacement keeps the content's identity and placement — only the media/content changes.
**Priority:** High

### TC-SA-07-04-017 — Version linkage: the replacement recorded as a new version (the prior preserved); the prior version is preserved (not destroyed)
**Type:** Positive
**Covers:** 4.3 → Version linkage: the replacement recorded as a new version (the prior preserved); Rule: the replacement is recorded as a new version; the prior version is preserved (not destroyed)
**Preconditions:** A content item is replaced with a new media version.
**Steps:**
1. Complete the replacement.
2. Verify the replacement is recorded as a new version.
3. Verify the prior version is preserved in the history (not destroyed).
**Expected Result:** The replacement is recorded as a new version — the prior version is preserved (not destroyed).
**Priority:** Critical

### TC-SA-07-04-018 — Learner impact: learners mid-consumption handled (their progress on the prior version); the impact is handled explicitly (progress carried over or reset); it is not silently dropped
**Type:** Negative
**Covers:** 4.3 → Learner impact: learners mid-consumption handled (their progress on the prior version); Rule: the learner impact is handled explicitly (progress carried over or reset); it is not silently dropped
**Preconditions:** Learners are mid-consumption of the prior version; a replacement is initiated.
**Steps:**
1. Confirm the learner impact: learners who were mid-consumption of the prior version.
2. Verify their progress is handled (carried over or reset, per the replacement's setting).
3. Verify the impact is handled explicitly (not silently dropped).
**Expected Result:** The learner impact is handled explicitly (progress carried over or reset) — it is not silently dropped.
**Priority:** Critical

### TC-SA-07-04-019 — Replacement validation: the new media validated (format, quality) before it goes live; a failing file is rejected and corrected
**Type:** Negative
**Covers:** 4.3 → Replacement validation: the new media validated (format, quality) before it goes live; Rule: a replacement swaps in new media; it is validated (format, quality) before going live
**Preconditions:** A new media version with a failing format/quality is prepared for replacement.
**Steps:**
1. Initiate the replacement with the failing media.
2. Verify the new media is validated (format, quality) before it goes live.
3. Verify the failing file is rejected and corrected.
**Expected Result:** The new media is validated (format, quality) before going live — a failing file is rejected and corrected.
**Priority:** Critical

### TC-SA-07-04-020 — Rollback: reverting to the prior version if the replacement is faulty; the rollback is recorded
**Type:** Negative
**Covers:** 4.3 → Rollback: reverting to the prior version if the replacement is faulty; Rule: a rollback reverts to the prior version if the replacement is faulty; the rollback is recorded
**Preconditions:** A replacement went live but the new version has an issue (a faulty replacement).
**Steps:**
1. Identify the faulty replacement.
2. Roll back to the prior version.
3. Verify the rollback is recorded.
**Expected Result:** The rollback reverts to the prior version — the rollback is recorded.
**Priority:** Critical

### TC-SA-07-04-021 — Replacement/update is audit-logged with the content, version, impact handling, and timestamp
**Type:** Positive
**Covers:** 4.3 → Audit logging of replacement/update; Rule: replacement/update is audit-logged with the content, version, impact handling, and timestamp
**Preconditions:** A content replacement/update has occurred.
**Steps:**
1. Open the audit trail and filter by "replacement/update".
2. Verify the entry shows the content, the version, the learner-impact handling, and the timestamp.
**Expected Result:** The replacement/update is audit-logged with the content, version, impact handling, and timestamp.
**Priority:** Critical
