# 4. Course Status Management — Test Cases

User Type: **Super Administrator**
Source: *Mi Digital Academy - Education CRM Features Document*
Spec: course_status_management.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 Draft, Publish, and Archive Courses | Course statuses: draft, published, archived | TC-SA-06-04-001 |
| 4.1 Draft, Publish, and Archive Courses | Draft: the course is being built; not visible or available to learners | TC-SA-06-04-002 |
| 4.1 Draft, Publish, and Archive Courses | Publish: the course goes live; visible and available for enrollment | TC-SA-06-04-003 |
| 4.1 Draft, Publish, and Archive Courses | Archive: the course is retired; no longer offered for new enrollment | TC-SA-06-04-004 |
| 4.1 Draft, Publish, and Archive Courses | Readiness check before publish: content complete, structure sound, profile set | TC-SA-06-04-005 |
| 4.1 Draft, Publish, and Archive Courses | Status transition: draft → published → archived (and draft/published → archived) | TC-SA-06-04-006 |
| 4.1 Draft, Publish, and Archive Courses | Reversibility: an archived course can be re-published; a published course can be re-drafted | TC-SA-06-04-007 |
| 4.1 Draft, Publish, and Archive Courses | Audit logging of status transitions | TC-SA-06-04-008 |
| 4.1 Draft, Publish, and Archive Courses | Rule: a draft course is not visible or available; it is the working state | TC-SA-06-04-002 |
| 4.1 Draft, Publish, and Archive Courses | Rule: publish is gated by the readiness check; a course with gaps is not published cleanly | TC-SA-06-04-005 |
| 4.1 Draft, Publish, and Archive Courses | Rule: archive retires the course for new enrollment but preserves existing learners' access and progress | TC-SA-06-04-004 |
| 4.1 Draft, Publish, and Archive Courses | Rule: transitions are reversible where sensible: archived → published (re-offer), published → draft (major revision) | TC-SA-06-04-007 |
| 4.1 Draft, Publish, and Archive Courses | Rule: a status transition is a single, recorded event; there is no ambiguous intermediate state | TC-SA-06-04-009 |
| 4.1 Draft, Publish, and Archive Courses | Rule: status transitions are audit-logged with the course, from/to status, and timestamp | TC-SA-06-04-008 |
| 4.2 Control Course Visibility and Availability | Visibility control: where the course is shown (public catalog, restricted, hidden) | TC-SA-06-04-010 |
| 4.2 Control Course Visibility and Availability | Availability control: who can enroll (public, by assignment, by audience) | TC-SA-06-04-011 |
| 4.2 Control Course Visibility and Availability | Audience restriction: the course available to specific groups/segments | TC-SA-06-04-012 |
| 4.2 Control Course Visibility and Availability | Assignment-only availability: the course not publicly listed, available only when assigned | TC-SA-06-04-013 |
| 4.2 Control Course Visibility and Availability | Board/grade scoping: an academic course visible in its board/grade context | TC-SA-06-04-014 |
| 4.2 Control Course Visibility and Availability | Preview: the course's presentation checked before it is surfaced | TC-SA-06-04-015 |
| 4.2 Control Course Visibility and Availability | Audit logging of visibility/availability changes | TC-SA-06-04-016 |
| 4.2 Control Course Visibility and Availability | Rule: visibility (where shown) and availability (who can enroll) are separate controls; a course can be visible but restricted, or available by assignment only | TC-SA-06-04-017 |
| 4.2 Control Course Visibility and Availability | Rule: an assignment-only course is not publicly listed; it is available only when assigned to a learner/group | TC-SA-06-04-013 |
| 4.2 Control Course Visibility and Availability | Rule: audience restriction limits enrollment to the defined groups/segments; others cannot enroll | TC-SA-06-04-012 |
| 4.2 Control Course Visibility and Availability | Rule: board/grade scoping applies to academic courses: they surface in their board context, not across boards | TC-SA-06-04-014 |
| 4.2 Control Course Visibility and Availability | Rule: a visibility/availability change is recorded; a course's reach is always auditable | TC-SA-06-04-016 |
| 4.2 Control Course Visibility and Availability | Rule: changes are audit-logged with the course, settings, and timestamp | TC-SA-06-04-016 |

## 4.1 Draft, Publish, and Archive Courses

### TC-SA-06-04-001 — Course statuses: draft, published, archived
**Type:** Positive
**Covers:** 4.1 → Course statuses: draft, published, archived
**Preconditions:** Courses exist in each status.
**Steps:**
1. Verify the three course statuses exist: draft, published, archived.
2. Verify each course has exactly one status at a time.
**Expected Result:** The course statuses (draft, published, archived) are available; each course has exactly one status.
**Priority:** Critical

### TC-SA-06-04-002 — Draft: the course is being built; not visible or available to learners
**Type:** Negative
**Covers:** 4.1 → Draft: the course is being built; not visible or available to learners; Rule: a draft course is not visible or available; it is the working state
**Preconditions:** A course is in draft status (being built).
**Steps:**
1. As a learner, browse the catalog.
2. Verify the draft course is not visible in the catalog.
3. Verify the draft course is not available for enrollment.
**Expected Result:** The draft course is not visible or available to learners — it is the working state.
**Priority:** Critical

### TC-SA-06-04-003 — Publish: the course goes live; visible and available for enrollment
**Type:** Positive
**Covers:** 4.1 → Publish: the course goes live; visible and available for enrollment
**Preconditions:** A draft course passes the readiness check.
**Steps:**
1. Run the publish action for the course.
2. Verify the course is now visible in the catalog.
3. Verify the course is available for enrollment.
**Expected Result:** The course is published — it is visible in the catalog and available for enrollment.
**Priority:** Critical

### TC-SA-06-04-004 — Archive: the course is retired; no longer offered for new enrollment; existing learners keep access and progress
**Type:** Negative
**Covers:** 4.1 → Archive: the course is retired; no longer offered for new enrollment; Rule: archive retires the course for new enrollment but preserves existing learners' access and progress
**Preconditions:** A published course is retired (a skill the platform is no longer offering); it has existing learners.
**Steps:**
1. Archive the course.
2. Verify it is removed from the catalog and no longer offered for new enrollment.
3. Verify existing learners keep their access and progress.
**Expected Result:** The archived course is removed from the catalog and not offered for new enrollment; existing learners keep their access and progress.
**Priority:** Critical

### TC-SA-06-04-005 — Readiness check before publish: content complete, structure sound, profile set; a course with gaps is not published cleanly
**Type:** Negative
**Covers:** 4.1 → Readiness check before publish: content complete, structure sound, profile set; Rule: publish is gated by the readiness check; a course with gaps is not published cleanly
**Preconditions:** Course A is ready (content complete, structure sound, profile set); Course B has a gap (a topic with no content).
**Steps:**
1. Publish Course A and verify the readiness check passes and it is published.
2. Attempt to publish Course B and verify the publish is blocked with the specific gaps listed.
3. Close Course B's gaps and re-publish; verify it is now published.
**Expected Result:** The readiness check gates publish — Course A publishes; Course B is blocked with the specific gaps listed until they are closed.
**Priority:** Critical

### TC-SA-06-04-006 — Status transition: draft → published → archived (and draft/published → archived)
**Type:** Positive
**Covers:** 4.1 → Status transition: draft → published → archived (and draft/published → archived)
**Preconditions:** A course is in draft status.
**Steps:**
1. Transition the course draft → published.
2. Transition the course published → archived.
3. Verify each transition is valid and the course's status updates.
**Expected Result:** The status transitions (draft → published → archived, and draft/published → archived) work as documented.
**Priority:** Critical

### TC-SA-06-04-007 — Reversibility: an archived course can be re-published; a published course can be re-drafted
**Type:** Edge
**Covers:** 4.1 → Reversibility: an archived course can be re-published; a published course can be re-drafted; Rule: transitions are reversible where sensible: archived → published (re-offer), published → draft (major revision)
**Preconditions:** Course A is archived (to be re-offered); Course B is published (needs a major revision).
**Steps:**
1. Re-publish Course A (archived → published) and verify it is available again.
2. Re-draft Course B (published → draft) and verify it is taken out of the catalog while revised.
3. Re-publish Course B after the revision.
**Expected Result:** The transitions are reversible where sensible — archived → published (re-offer) and published → draft (major revision) both work.
**Priority:** High

### TC-SA-06-04-008 — Status transitions are audit-logged with the course, from/to status, and timestamp
**Type:** Positive
**Covers:** 4.1 → Audit logging of status transitions; Rule: status transitions are audit-logged with the course, from/to status, and timestamp
**Preconditions:** Courses have undergone status transitions.
**Steps:**
1. Open the audit trail and filter by "status".
2. Verify entries for each transition with the course, the from/to status, and the timestamp.
**Expected Result:** Each status transition is audit-logged with the course, from/to status, and timestamp.
**Priority:** Critical

### TC-SA-06-04-009 — A status transition is a single, recorded event; there is no ambiguous intermediate state
**Type:** Edge
**Covers:** 4.1 → Rule: a status transition is a single, recorded event; there is no ambiguous intermediate state
**Preconditions:** A course is transitioning from draft to published.
**Steps:**
1. Run the publish action.
2. Verify the transition is a single, recorded event (no ambiguous intermediate state).
3. Verify the course's status is unambiguously "published" after the transition.
**Expected Result:** The status transition is a single, recorded event — there is no ambiguous intermediate state.
**Priority:** High

## 4.2 Control Course Visibility and Availability

### TC-SA-06-04-010 — Visibility control: where the course is shown (public catalog, restricted, hidden)
**Type:** Positive
**Covers:** 4.2 → Visibility control: where the course is shown (public catalog, restricted, hidden)
**Preconditions:** A course exists.
**Steps:**
1. Set the course's visibility to public (shown in the catalog).
2. Set another course's visibility to restricted (shown to specific audiences).
3. Set a third course's visibility to hidden (not listed).
4. Verify each course is shown per its visibility setting.
**Expected Result:** The visibility control works — public is shown in the catalog, restricted is shown to specific audiences, hidden is not listed.
**Priority:** Critical

### TC-SA-06-04-011 — Availability control: who can enroll (public, by assignment, by audience)
**Type:** Positive
**Covers:** 4.2 → Availability control: who can enroll (public, by assignment, by audience)
**Preconditions:** Courses exist with different availability settings.
**Steps:**
1. Set a course's availability to public (anyone can enroll).
2. Set another course's availability to by assignment (only assigned learners).
3. Set a third course's availability to by audience (specific segments).
4. Verify enrollment is allowed per the availability setting.
**Expected Result:** The availability control works — public allows anyone, by assignment allows only assigned learners, by audience allows specific segments.
**Priority:** Critical

### TC-SA-06-04-012 — Audience restriction: the course available to specific groups/segments; others cannot enroll
**Type:** Negative
**Covers:** 4.2 → Audience restriction: the course available to specific groups/segments; Rule: audience restriction limits enrollment to the defined groups/segments; others cannot enroll
**Preconditions:** A course is available by audience (a specific segment); a learner is outside the segment.
**Steps:**
1. As a learner in the segment, verify they can enroll.
2. As a learner outside the segment, attempt to enroll.
3. Verify the outside learner cannot enroll.
**Expected Result:** The audience restriction limits enrollment to the defined groups/segments — others cannot enroll.
**Priority:** Critical

### TC-SA-06-04-013 — Assignment-only availability: the course not publicly listed, available only when assigned to a learner/group
**Type:** Negative
**Covers:** 4.2 → Assignment-only availability: the course not publicly listed, available only when assigned; Rule: an assignment-only course is not publicly listed; it is available only when assigned to a learner/group
**Preconditions:** An internal training course is set hidden and assignment-only.
**Steps:**
1. Verify the course is not in the public catalog.
2. Assign the course to a learner/group.
3. Verify the assigned learner can access the course; an unassigned learner cannot.
**Expected Result:** The assignment-only course is not publicly listed — it is available only when assigned to a learner/group.
**Priority:** Critical

### TC-SA-06-04-014 — Board/grade scoping: an academic course visible in its board/grade context, not across boards
**Type:** Negative
**Covers:** 4.2 → Board/grade scoping: an academic course visible in its board/grade context; Rule: board/grade scoping applies to academic courses: they surface in their board context, not across boards
**Preconditions:** A board-specific academic course is scoped to its board/grade context.
**Steps:**
1. As a learner in the course's board/grade, verify the course appears.
2. As a learner in another board, verify the course does not appear in their catalog.
**Expected Result:** The academic course surfaces in its board/grade context — not across boards.
**Priority:** High

### TC-SA-06-04-015 — Preview: the course's presentation checked before it is surfaced
**Type:** Positive
**Covers:** 4.2 → Preview: the course's presentation checked before it is surfaced
**Preconditions:** A course's visibility setting is about to be confirmed.
**Steps:**
1. Preview the course's presentation (how it appears where it is surfaced).
2. Verify the presentation is correct before confirming the visibility setting.
**Expected Result:** The course's presentation is previewed before it is surfaced — the visibility setting is confirmed with the correct presentation.
**Priority:** Medium

### TC-SA-06-04-016 — Visibility/availability changes are audit-logged with the course, settings, and timestamp; a course's reach is always auditable
**Type:** Positive
**Covers:** 4.2 → Audit logging of visibility/availability changes; Rule: a visibility/availability change is recorded; a course's reach is always auditable; Rule: changes are audit-logged with the course, settings, and timestamp
**Preconditions:** A course's visibility/availability has been changed (e.g., from a pilot restricted to general public).
**Steps:**
1. Open the audit trail and filter by "visibility/availability".
2. Verify the entry shows the course, the settings, and the timestamp.
3. Verify the course's reach is auditable from the trail.
**Expected Result:** The visibility/availability change is audit-logged with the course, settings, and timestamp — the course's reach is always auditable.
**Priority:** Critical

### TC-SA-06-04-017 — Visibility and availability are separate controls: a course can be visible but restricted, or available by assignment only
**Type:** Edge
**Covers:** 4.2 → Rule: visibility (where shown) and availability (who can enroll) are separate controls; a course can be visible but restricted, or available by assignment only
**Preconditions:** A course is set visible (restricted) but available by assignment only.
**Steps:**
1. Verify the course is shown to the restricted audience (visibility).
2. Verify only assigned learners can enroll (availability), even though the course is visible.
**Expected Result:** Visibility and availability are separate controls — the course is visible but restricted, and available by assignment only.
**Priority:** High
