# 2. Doubt Clearing Sessions — Test Cases

User Type: **Super Administrator**
Source: *Mi Digital Academy - Education CRM Features Document*
Spec: doubt_clearing_sessions.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 |
|---------|--------------------|----------|
| 2.1 1-on-1 Session Booking | Booking availability windows per teacher | TC-SA-LS-6-001 |
| 2.1 1-on-1 Session Booking | Session duration and teacher capacity limits | TC-SA-LS-6-002 |
| 2.1 1-on-1 Session Booking | Plan-based entitlement (sessions per month by tier) | TC-SA-LS-6-003 |
| 2.1 1-on-1 Session Booking | Cancellation and rescheduling rules | TC-SA-LS-6-004 |
| 2.1 1-on-1 Session Booking | Rule: booking beyond entitlement is blocked | TC-SA-LS-6-005 |
| 2.1 1-on-1 Session Booking | Rule: booking outside availability window not allowed | TC-SA-LS-6-006 |
| 2.1 1-on-1 Session Booking | Audit logging of 1-on-1 session booking | TC-SA-LS-6-007 |
| 2.2 Group Doubt Solving Sessions | Group size limits and topic focus | TC-SA-LS-7-001 |
| 2.2 Group Doubt Solving Sessions | Scheduling and student enrollment | TC-SA-LS-7-002 |
| 2.2 Group Doubt Solving Sessions | Rule: enrollment blocked at size limit | TC-SA-LS-7-003 |
| 2.2 Group Doubt Solving Sessions | Rule: empty session flagged | TC-SA-LS-7-004 |
| 2.2 Group Doubt Solving Sessions | Audit logging of group doubt sessions | TC-SA-LS-7-005 |
| 2.3 Drop-In Office Hours | Open slot scheduling and teacher availability | TC-SA-LS-8-001 |
| 2.3 Drop-In Office Hours | Capacity per slot and first-come-first-served | TC-SA-LS-8-002 |
| 2.3 Drop-In Office Hours | Rule: full slot rejects further joins | TC-SA-LS-8-003 |
| 2.3 Drop-In Office Hours | Rule: outside-window slots not joinable | TC-SA-LS-8-004 |
| 2.3 Drop-In Office Hours | Audit logging of office hours configuration | TC-SA-LS-8-005 |
| 2.4 AI-Assisted Doubt Resolution Escalation | AI confidence threshold for auto-resolution | TC-SA-LS-9-001 |
| 2.4 AI-Assisted Doubt Resolution Escalation | Escalation triggers (low confidence, request, repeated failure) | TC-SA-LS-9-002 |
| 2.4 AI-Assisted Doubt Resolution Escalation | Escalation routing (subject/on-duty teacher) | TC-SA-LS-9-003 |
| 2.4 AI-Assisted Doubt Resolution Escalation | Escalation context passed (doubt, AI attempt, progress) | TC-SA-LS-9-004 |
| 2.4 AI-Assisted Doubt Resolution Escalation | Rule: student can always request human escalation | TC-SA-LS-9-005 |
| 2.4 AI-Assisted Doubt Resolution Escalation | Audit logging of doubt resolution escalation | TC-SA-LS-9-006 |

## 2.1 1-on-1 Session Booking

### TC-SA-LS-6-001 — Booking availability windows per teacher
**Type:** Positive
**Covers:** 2.1 → Booking availability windows
**Preconditions:** A Super Admin account is active; teachers exist.
**Steps:**
1. As a Super Admin, define each teacher's availability windows.
2. Verify bookings are only possible within the windows.
**Expected Result:** Booking availability windows — delivered exactly as documented.
**Priority:** Critical

### TC-SA-LS-6-002 — Session duration and teacher capacity limits
**Type:** Positive
**Covers:** 2.1 → Duration and capacity
**Preconditions:** 1-on-1 booking is enabled.
**Steps:**
1. Set the session duration and teacher capacity limits.
2. Verify the limits are enforced on bookings.
**Expected Result:** Session duration and teacher capacity limits — delivered exactly as documented.
**Priority:** High

### TC-SA-LS-6-003 — Plan-based entitlement (sessions per month by tier)
**Type:** Positive
**Covers:** 2.1 → Plan-based entitlement
**Preconditions:** Subscription tiers with entitlements exist.
**Steps:**
1. Set the entitlement (e.g., 2 sessions/month on the All Subjects tier).
2. Verify a student's booking is limited to their entitlement.
**Expected Result:** Plan-based entitlement — delivered exactly as documented.
**Priority:** Critical

### TC-SA-LS-6-004 — Cancellation and rescheduling rules
**Type:** Positive
**Covers:** 2.1 → Cancellation and rescheduling
**Preconditions:** A 1-on-1 booking exists.
**Steps:**
1. Cancel the booking and verify the slot is freed and entitlement restored per rules.
2. Reschedule a booking and verify the new slot.
**Expected Result:** Cancellation and rescheduling rules — delivered exactly as documented.
**Priority:** High

### TC-SA-LS-6-005 — Rule: booking beyond entitlement is blocked
**Type:** Negative
**Covers:** 2.1 → Rule: entitlement enforcement
**Preconditions:** A student has used their full monthly entitlement.
**Steps:**
1. Attempt to book another 1-on-1 session.
2. Verify the booking is blocked with the reason.
**Expected Result:** A student cannot book beyond their plan entitlement — delivered exactly as documented.
**Priority:** Critical

### TC-SA-LS-6-006 — Rule: booking outside availability window not allowed
**Type:** Negative
**Covers:** 2.1 → Rule: availability enforcement
**Preconditions:** A teacher's availability windows are defined.
**Steps:**
1. Attempt to book outside a teacher's availability window.
2. Verify the booking is not allowed.
**Expected Result:** A booking outside a teacher's availability window is not allowed — delivered exactly as documented.
**Priority:** High

### TC-SA-LS-6-007 — Audit logging of 1-on-1 session booking
**Type:** Positive
**Covers:** 2.1 → Audit logging
**Preconditions:** 1-on-1 booking actions have been performed.
**Steps:**
1. Open the audit trail and filter by 1-on-1 booking.
2. Verify entries show the student, teacher, session, and timestamp.
**Expected Result:** Audit logging of 1-on-1 session booking — delivered exactly as documented.
**Priority:** Critical

## 2.2 Group Doubt Solving Sessions

### TC-SA-LS-7-001 — Group size limits and topic focus
**Type:** Positive
**Covers:** 2.2 → Group size and topic focus
**Preconditions:** A Super Admin is creating a group doubt session.
**Steps:**
1. Set the group size limits and create a session with a topic/doubt focus.
2. Verify the limits and focus are applied.
**Expected Result:** Group size limits and topic focus — delivered exactly as documented.
**Priority:** High

### TC-SA-LS-7-002 — Scheduling and student enrollment
**Type:** Positive
**Covers:** 2.2 → Scheduling and enrollment
**Preconditions:** A group doubt session is created.
**Steps:**
1. Schedule the session (one-off or recurring).
2. Enroll students (self or teacher-assigned) and verify enrollment.
**Expected Result:** Scheduling and student enrollment — delivered exactly as documented.
**Priority:** High

### TC-SA-LS-7-003 — Rule: enrollment blocked at size limit
**Type:** Negative
**Covers:** 2.2 → Rule: size limit enforcement
**Preconditions:** A group doubt session is at its size limit.
**Steps:**
1. Attempt to enroll another student.
2. Verify enrollment is blocked and the late joiner is flagged.
**Expected Result:** Enrollment is blocked at the group size limit — delivered exactly as documented.
**Priority:** High

### TC-SA-LS-7-004 — Rule: empty session flagged
**Type:** Negative
**Covers:** 2.2 → Rule: empty session flag
**Preconditions:** A group doubt session has no enrolled students.
**Steps:**
1. Reach the session time with zero enrollments.
2. Verify the session is flagged (not silently run empty).
**Expected Result:** A session with no enrolled students is flagged — delivered exactly as documented.
**Priority:** Medium

### TC-SA-LS-7-005 — Audit logging of group doubt sessions
**Type:** Positive
**Covers:** 2.2 → Audit logging
**Preconditions:** Group doubt session actions have been performed.
**Steps:**
1. Open the audit trail and filter by group doubt sessions.
2. Verify entries show the session, the actor, and the timestamp.
**Expected Result:** Audit logging of group doubt sessions — delivered exactly as documented.
**Priority:** Critical

## 2.3 Drop-In Office Hours

### TC-SA-LS-8-001 — Open slot scheduling and teacher availability
**Type:** Positive
**Covers:** 2.3 → Open slot scheduling
**Preconditions:** A Super Admin is configuring office hours.
**Steps:**
1. Define the recurring open slots and assign teachers.
2. Verify the slots and availability are applied.
**Expected Result:** Open slot scheduling and teacher availability — delivered exactly as documented.
**Priority:** High

### TC-SA-LS-8-002 — Capacity per slot and first-come-first-served
**Type:** Positive
**Covers:** 2.3 → Capacity and join rules
**Preconditions:** Office hours slots are defined with capacity.
**Steps:**
1. Set the capacity per slot.
2. Verify students join first-come-first-served up to capacity.
**Expected Result:** Capacity per slot and first-come-first-served — delivered exactly as documented.
**Priority:** High

### TC-SA-LS-8-003 — Rule: full slot rejects further joins
**Type:** Negative
**Covers:** 2.3 → Rule: full slot rejection
**Preconditions:** An office hours slot is at full capacity.
**Steps:**
1. Attempt to join the full slot.
2. Verify the join is rejected with a "full" indication.
**Expected Result:** A slot at full capacity rejects further joins — delivered exactly as documented.
**Priority:** High

### TC-SA-LS-8-004 — Rule: outside-window slots not joinable
**Type:** Negative
**Covers:** 2.3 → Rule: window enforcement
**Preconditions:** Office hours windows are defined.
**Steps:**
1. Attempt to join outside the defined window.
2. Verify the join is not allowed.
**Expected Result:** Office hours outside the defined windows are not joinable — delivered exactly as documented.
**Priority:** Medium

### TC-SA-LS-8-005 — Audit logging of office hours configuration
**Type:** Positive
**Covers:** 2.3 → Audit logging
**Preconditions:** Office hours configuration changes have been made.
**Steps:**
1. Open the audit trail and filter by office hours.
2. Verify entries show the slots, the change, and the timestamp.
**Expected Result:** Audit logging of office hours configuration — delivered exactly as documented.
**Priority:** Critical

## 2.4 AI-Assisted Doubt Resolution Escalation

### TC-SA-LS-9-001 — AI confidence threshold for auto-resolution
**Type:** Positive
**Covers:** 2.4 → Confidence threshold
**Preconditions:** AI-first resolution is enabled.
**Steps:**
1. Set the confidence threshold.
2. Verify a doubt resolved above the threshold is auto-resolved without escalation.
**Expected Result:** AI confidence threshold for auto-resolution — delivered exactly as documented.
**Priority:** High

### TC-SA-LS-9-002 — Escalation triggers (low confidence, request, repeated failure)
**Type:** Positive
**Covers:** 2.4 → Escalation triggers
**Preconditions:** AI-first resolution is enabled.
**Steps:**
1. Trigger escalation via low confidence, student request, and repeated failure (separately).
2. Verify each trigger escalates the doubt.
**Expected Result:** Escalation triggers — delivered exactly as documented.
**Priority:** Critical

### TC-SA-LS-9-003 — Escalation routing (subject/on-duty teacher)
**Type:** Positive
**Covers:** 2.4 → Escalation routing
**Preconditions:** An escalation is triggered.
**Steps:**
1. Set routing to the subject teacher and verify routing.
2. Set routing to the on-duty teacher and verify routing.
**Expected Result:** Escalation routing — delivered exactly as documented.
**Priority:** High

### TC-SA-LS-9-004 — Escalation context passed (doubt, AI attempt, progress)
**Type:** Positive
**Covers:** 2.4 → Escalation context
**Preconditions:** An escalation is triggered.
**Steps:**
1. Escalate a doubt.
2. Verify the routed teacher receives the doubt, the AI attempt, and the student's progress.
**Expected Result:** Escalation context passed — delivered exactly as documented.
**Priority:** High

### TC-SA-LS-9-005 — Rule: student can always request human escalation
**Type:** Negative
**Covers:** 2.4 → Rule: human escalation request
**Preconditions:** The AI resolved a doubt above the confidence threshold.
**Steps:**
1. The student requests escalation to a human.
2. Verify the escalation proceeds regardless of the AI result.
**Expected Result:** A student can always request escalation to a human — delivered exactly as documented.
**Priority:** Critical

### TC-SA-LS-9-006 — Audit logging of doubt resolution escalation
**Type:** Positive
**Covers:** 2.4 → Audit logging
**Preconditions:** Escalations have occurred.
**Steps:**
1. Open the audit trail and filter by doubt resolution escalation.
2. Verify entries show the doubt, the trigger, the routed teacher, and the timestamp.
**Expected Result:** Audit logging of doubt resolution escalation — delivered exactly as documented.
**Priority:** Critical
