# 4. Discussion Forums — Test Cases

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

## Test Execution Policy

- Zero tolerance: any deviation from the documented behavior is a defect.
- Every failed test is logged with a Bug ID, the feature, the sub-feature, the expected vs actual result, and the severity; 100% of bugs are fixed before the group passes.
- 100% pass rate is required for the group to be marked complete.

## Coverage Matrix

| Feature | Sub-feature / Rule | Test IDs |
|---------|--------------------|----------|
| 4.1 Subject-Wise Forum Management | Forum creation per subject | TC-SA-SL-13-001 |
| 4.1 Subject-Wise Forum Management | Forum visibility (grade, tier, all) | TC-SA-SL-13-002 |
| 4.1 Subject-Wise Forum Management | Posting rules (login, min reputation) | TC-SA-SL-13-003 |
| 4.1 Subject-Wise Forum Management | Forum lifecycle (active, paused, archived) | TC-SA-SL-13-004 |
| 4.1 Subject-Wise Forum Management | Rule: paused forum accepts no new posts | TC-SA-SL-13-005 |
| 4.1 Subject-Wise Forum Management | Rule: archived forum is read-only | TC-SA-SL-13-006 |
| 4.1 Subject-Wise Forum Management | Audit logging of forum management | TC-SA-SL-13-007 |
| 4.2 Thread Moderation | Thread reporting and moderation queue | TC-SA-SL-14-001 |
| 4.2 Thread Moderation | Thread locking/closing | TC-SA-SL-14-002 |
| 4.2 Thread Moderation | Thread moving between forums | TC-SA-SL-14-003 |
| 4.2 Thread Moderation | Thread removal with reason | TC-SA-SL-14-004 |
| 4.2 Thread Moderation | Rule: locked thread accepts no further replies | TC-SA-SL-14-005 |
| 4.2 Thread Moderation | Rule: moved thread preserves replies and history | TC-SA-SL-14-006 |
| 4.2 Thread Moderation | Audit logging of thread moderation | TC-SA-SL-14-007 |
| 4.3 Pinned Discussions | Pin a discussion to a forum | TC-SA-SL-15-001 |
| 4.3 Pinned Discussions | Pin ordering and pin expiry | TC-SA-SL-15-002 |
| 4.3 Pinned Discussions | Unpin (manual) | TC-SA-SL-15-003 |
| 4.3 Pinned Discussions | Rule: pin with expiry auto-unpins | TC-SA-SL-15-004 |
| 4.3 Pinned Discussions | Rule: removed discussion auto-unpinned | TC-SA-SL-15-005 |
| 4.3 Pinned Discussions | Audit logging of pinned discussions | TC-SA-SL-15-006 |
| 4.4 Search Configuration | Search scope and fields | TC-SA-SL-16-001 |
| 4.4 Search Configuration | Result ranking (relevance, recency, upvotes) | TC-SA-SL-16-002 |
| 4.4 Search Configuration | Search indexing and refresh frequency | TC-SA-SL-16-003 |
| 4.4 Search Configuration | Rule: search respects forum visibility | TC-SA-SL-16-004 |
| 4.4 Search Configuration | Rule: archived forum excluded from search | TC-SA-SL-16-005 |
| 4.4 Search Configuration | Audit logging of search configuration | TC-SA-SL-16-006 |

## 4.1 Subject-Wise Forum Management

### TC-SA-SL-13-001 — Forum creation per subject
**Type:** Positive
**Covers:** 4.1 → Forum creation
**Preconditions:** A Super Admin account is active; subjects exist.
**Steps:**
1. As a Super Admin, create a forum per subject.
2. Verify the forum is created and listed under its subject.
**Expected Result:** Forum creation per subject — delivered exactly as documented.
**Priority:** Critical

### TC-SA-SL-13-002 — Forum visibility (grade, tier, all)
**Type:** Positive
**Covers:** 4.1 → Forum visibility
**Preconditions:** A subject forum is created.
**Steps:**
1. Set the forum visibility to by grade, by subscription tier, and all (separately).
2. Verify each visibility scopes access correctly.
**Expected Result:** Forum visibility — delivered exactly as documented.
**Priority:** High

### TC-SA-SL-13-003 — Posting rules (login, min reputation)
**Type:** Positive
**Covers:** 4.1 → Posting rules
**Preconditions:** A subject forum is active.
**Steps:**
1. Configure the posting rules (login required, min reputation to post).
2. Verify the rules are enforced on posting.
**Expected Result:** Posting rules — delivered exactly as documented.
**Priority:** High

### TC-SA-SL-13-004 — Forum lifecycle (active, paused, archived)
**Type:** Positive
**Covers:** 4.1 → Forum lifecycle
**Preconditions:** A subject forum exists.
**Steps:**
1. Set the forum to active, paused, and archived (separately).
2. Verify each lifecycle state behaves as defined.
**Expected Result:** Forum lifecycle — delivered exactly as documented.
**Priority:** High

### TC-SA-SL-13-005 — Rule: paused forum accepts no new posts
**Type:** Negative
**Covers:** 4.1 → Rule: paused forum
**Preconditions:** A forum is paused.
**Steps:**
1. Attempt to post in the paused forum.
2. Verify no new post is accepted and existing threads remain readable.
**Expected Result:** A paused forum accepts no new posts; existing threads remain readable — delivered exactly as documented.
**Priority:** High

### TC-SA-SL-13-006 — Rule: archived forum is read-only
**Type:** Negative
**Covers:** 4.1 → Rule: archived forum
**Preconditions:** A forum is archived.
**Steps:**
1. Attempt to create a new thread or reply in the archived forum.
2. Verify no new threads or replies are accepted.
**Expected Result:** An archived forum is read-only — delivered exactly as documented.
**Priority:** High

### TC-SA-SL-13-007 — Audit logging of forum management
**Type:** Positive
**Covers:** 4.1 → Audit logging
**Preconditions:** Forum actions have been performed.
**Steps:**
1. Open the audit trail and filter by forum management.
2. Verify entries show the forum, the action, and the timestamp.
**Expected Result:** Audit logging of forum management — delivered exactly as documented.
**Priority:** Critical

## 4.2 Thread Moderation

### TC-SA-SL-14-001 — Thread reporting and moderation queue
**Type:** Positive
**Covers:** 4.2 → Reporting and queue
**Preconditions:** A forum thread is reported by a member.
**Steps:**
1. Report a thread.
2. Verify it appears in the moderation queue for review.
**Expected Result:** Thread reporting and moderation queue — delivered exactly as documented.
**Priority:** High

### TC-SA-SL-14-002 — Thread locking/closing
**Type:** Positive
**Covers:** 4.2 → Thread locking/closing
**Preconditions:** A resolved forum thread exists.
**Steps:**
1. Lock/close the thread.
2. Verify no further replies are accepted.
**Expected Result:** Thread locking/closing — delivered exactly as documented.
**Priority:** High

### TC-SA-SL-14-003 — Thread moving between forums
**Type:** Positive
**Covers:** 4.2 → Thread moving
**Preconditions:** An off-topic thread exists.
**Steps:**
1. Move the thread to the correct forum/sub-forum.
2. Verify the thread appears at the new location.
**Expected Result:** Thread moving between forums — delivered exactly as documented.
**Priority:** Medium

### TC-SA-SL-14-004 — Thread removal with reason
**Type:** Negative
**Covers:** 4.2 → Thread removal
**Preconditions:** A forum thread must be removed.
**Steps:**
1. Remove the thread with a reason.
2. Verify the thread is taken down and the removal is recorded.
**Expected Result:** Thread removal — delivered exactly as documented.
**Priority:** High

### TC-SA-SL-14-005 — Rule: locked thread accepts no further replies
**Type:** Negative
**Covers:** 4.2 → Rule: locked thread
**Preconditions:** A thread is locked.
**Steps:**
1. Attempt to reply to the locked thread.
2. Verify the reply is not accepted and existing content remains readable.
**Expected Result:** A locked thread accepts no further replies — delivered exactly as documented.
**Priority:** High

### TC-SA-SL-14-006 — Rule: moved thread preserves replies and history
**Type:** Negative
**Covers:** 4.2 → Rule: move preserves history
**Preconditions:** A thread with replies is moved.
**Steps:**
1. Move the thread to a new forum.
2. Verify its replies and history are preserved at the new location.
**Expected Result:** A moved thread preserves its replies and history — delivered exactly as documented.
**Priority:** High

### TC-SA-SL-14-007 — Audit logging of thread moderation
**Type:** Positive
**Covers:** 4.2 → Audit logging
**Preconditions:** Thread moderation actions have been performed.
**Steps:**
1. Open the audit trail and filter by thread moderation.
2. Verify entries show the thread, the action, the reason, and the timestamp.
**Expected Result:** Audit logging of thread moderation — delivered exactly as documented.
**Priority:** Critical

## 4.3 Pinned Discussions

### TC-SA-SL-15-001 — Pin a discussion to a forum
**Type:** Positive
**Covers:** 4.3 → Pin a discussion
**Preconditions:** A forum has an important discussion.
**Steps:**
1. As a Super Admin, pin the discussion to the forum.
2. Verify it appears at the top of the forum.
**Expected Result:** Pin a discussion to a forum — delivered exactly as documented.
**Priority:** High

### TC-SA-SL-15-002 — Pin ordering and pin expiry
**Type:** Positive
**Covers:** 4.3 → Pin ordering and expiry
**Preconditions:** A forum has multiple pinned discussions.
**Steps:**
1. Order multiple pins and verify the order.
2. Set a pin expiry and verify it is recorded.
**Expected Result:** Pin ordering and pin expiry — delivered exactly as documented.
**Priority:** Medium

### TC-SA-SL-15-003 — Unpin (manual)
**Type:** Positive
**Covers:** 4.3 → Unpin
**Preconditions:** A discussion is pinned.
**Steps:**
1. Unpin the discussion manually.
2. Verify it no longer appears at the top.
**Expected Result:** Unpin — delivered exactly as documented.
**Priority:** Medium

### TC-SA-SL-15-004 — Rule: pin with expiry auto-unpins
**Type:** Edge
**Covers:** 4.3 → Rule: pin expiry
**Preconditions:** A pin has an expiry period.
**Steps:**
1. Let the pin expiry period elapse.
2. Verify the pin auto-unpins.
**Expected Result:** A pin with an expiry auto-unpins when the period elapses — delivered exactly as documented.
**Priority:** Medium

### TC-SA-SL-15-005 — Rule: removed discussion auto-unpinned
**Type:** Negative
**Covers:** 4.3 → Rule: removal unpins
**Preconditions:** A pinned discussion is removed.
**Steps:**
1. Remove the pinned discussion.
2. Verify it is automatically unpinned.
**Expected Result:** A removed discussion is automatically unpinned — delivered exactly as documented.
**Priority:** High

### TC-SA-SL-15-006 — Audit logging of pinned discussions
**Type:** Positive
**Covers:** 4.3 → Audit logging
**Preconditions:** Pin actions have been performed.
**Steps:**
1. Open the audit trail and filter by pinned discussions.
2. Verify entries show the discussion, the forum, the action, and the timestamp.
**Expected Result:** Audit logging of pinned discussions — delivered exactly as documented.
**Priority:** Critical

## 4.4 Search Configuration

### TC-SA-SL-16-001 — Search scope and fields
**Type:** Positive
**Covers:** 4.4 → Search scope and fields
**Preconditions:** A Super Admin is configuring forum search.
**Steps:**
1. Set the search scope (all forums or per subject) and the search fields (title, body, author).
2. Run a query and verify results respect the scope and fields.
**Expected Result:** Search scope and fields — delivered exactly as documented.
**Priority:** High

### TC-SA-SL-16-002 — Result ranking (relevance, recency, upvotes)
**Type:** Positive
**Covers:** 4.4 → Result ranking
**Preconditions:** Forum search is configured.
**Steps:**
1. Configure the result ranking (relevance, recency, upvotes).
2. Run a query and verify results are ranked per the weights.
**Expected Result:** Result ranking — delivered exactly as documented.
**Priority:** Medium

### TC-SA-SL-16-003 — Search indexing and refresh frequency
**Type:** Positive
**Covers:** 4.4 → Search indexing
**Preconditions:** Forum search is configured.
**Steps:**
1. Set the search indexing scope and refresh frequency.
2. Add new content and verify it is indexed per the refresh frequency.
**Expected Result:** Search indexing — delivered exactly as documented.
**Priority:** Medium

### TC-SA-SL-16-004 — Rule: search respects forum visibility
**Type:** Negative
**Covers:** 4.4 → Rule: visibility in search
**Preconditions:** A user cannot see a particular forum.
**Steps:**
1. Run a search that would match content in the invisible forum.
2. Verify the content is not returned to the user.
**Expected Result:** Search respects forum visibility — delivered exactly as documented.
**Priority:** Critical

### TC-SA-SL-16-005 — Rule: archived forum excluded from search
**Type:** Negative
**Covers:** 4.4 → Rule: archived exclusion
**Preconditions:** A forum is archived.
**Steps:**
1. Run a search that would match content in the archived forum.
2. Verify the archived content is excluded from results.
**Expected Result:** An archived forum's content is excluded from search by default — delivered exactly as documented.
**Priority:** High

### TC-SA-SL-16-006 — Audit logging of search configuration
**Type:** Positive
**Covers:** 4.4 → Audit logging
**Preconditions:** Search configuration changes have been made.
**Steps:**
1. Open the audit trail and filter by search configuration.
2. Verify entries show the change and the timestamp.
**Expected Result:** Audit logging of search configuration — delivered exactly as documented.
**Priority:** Critical
