14 — QA Checklist (Exams Module)
- 1. Functional — planning (S1/S2/S4/S8)
- 2. Validation & edge cases (module-specific)
- 3. Errors & resilience
- 4. A11y (00-shared/09)
- 5. Responsive & theming
- 6. Performance
- 7. Security & tenancy
- 8. Analytics
(proposed)
Test checklist grounded in the implemented backend contract. Every item is traceable to a source behavior; run against 00-shared/10_QA_Baseline.md. Coverage targets: unit (cubits/forms), widget, integration (mock API), E2E (against
npm run test:e2estack with MongoDB + Redis).
1. Functional — planning (S1/S2/S4/S8)
-
List loads page 1 (limit default 20); scrolling appends pages;
hasNext: falseshows end-of-list; pull-to-refresh resets to page 1 (examination.service.ts:67-79). -
Create exam → POST returns doc with
status: 'draft'regardless of payload (examination.service.ts:48); detail shows badgedraft. -
Edit exam → PATCH
$setonly sent fields;versionincrements (base.repository.ts:57-66); unchanged fields untouched. -
Delete exam → soft delete; exam disappears from list; slots/results remain
(no cascade —
examination.service.ts:99-110); direct slot read after delete → 404. -
Add subject slot → appears in
GET /examinations/:id/subjectsorder;examinationIdtaken from route, never from body (examination.service.ts:49). -
Slot fields persist exactly:
date(Date),startTime/endTimeas'HH:mm'strings,maximumMarks/passingMarksnumbers (examination-subject.schema.ts:18-31).
2. Validation & edge cases (module-specific)
-
Max marks: submit
marksObtained > maximumMarks→ server returns 404NotFoundException"Marks cannot exceed maximum." (examination.service.ts:145-146); client pre-validation blocks typing beyond max digits and shows inline error; server 404 path → slot-max refresh + re-enter. -
Pass marks: client blocks
passingMarks > maximumMarks(OQ-6); server accepts (both@Min(1)only,examination-subject.dto.ts:36-44) — confirm the warning banner onSlotHeaderCardwhen an invalid config exists server-side. -
Duplicate exam-subject: adding the same subject twice succeeds server-side
(non-unique index,
examination-subject.schema.ts:37) — client warns "already scheduled" (OQ-3); confirm warn-then-proceed flow. - Subject date conflicts: no server rejection (OQ-2) — verify the overlap warning dialog on submit and that "add anyway" proceeds.
-
Exam window inversion (
startDate > endDate) and time inversion (endTime ≤ startTime) → client-only inline errors; server accepts — verify the client refuses to submit (OQ-6). -
Publish immutability: after publish — Publish/Edit/Delete/Add-subject
hidden; marks edits show published confirm sheet (OQ-5). Verify against server:
re-POST publish succeeds (no guard,
examination.service.ts:203-220) and PATCH status'garbage'persists without enum validation (updateByIdnorunValidators) — document as known server gaps, client must not rely on them. -
Status transitions: create →
draft; publish →published;active/completedonly via explicit user action (OQ-1); client never sendsstatuson create; status picker disabled whenpublished. -
Missing marks on report card: subject without result →
0/max+ "not marked" hint; all-unmarked exam → percentage 0, grade F with explanatory note (result.service.ts:70, 83-95, 137). -
Empty slot list on report card: 404 "No subjects found for this
examination." → empty state, no retry loop (
result.service.ts:51-53). -
Free-text per-subject grade: grade sent as-is (A+/A/B+/B/C/D/F suggested);
empty grade renders "—" (
examination-subject.dto.ts:57-60; OQ-9). -
Marks upsert: same student+slot saved twice → single doc, second write
updates in place (
examination.service.ts:147-175); unique index{tenantId, studentId, examinationSubjectId}(examination-result.schema.ts:31-33).
3. Errors & resilience
-
404 "Examination not found." → purge cache, pop to list, snackbar
(
examination.service.ts:63, 87, 101). -
404 "Exam subject not found." → pop to detail, refresh slots
(
examination.service.ts:144). -
400
VALIDATION_ERROR→ inline field errors, first invalid focused. - 429 → backoff + countdown, no auto-retry (00-shared/07 §4).
-
5xx → generic +
requestId, retry offered, last-good cache served. - Offline marks entry: rows queue (dashed + cloud icon); flush on reconnect with idempotency; dedupe last-write-wins; 5-attempt cap surfaces "review" state; 409 flush collision → preview sheet (overwrite/discard) (13 §4).
- Publish offline → disabled (online-only); never optimistic flip (13 §2).
4. A11y (00-shared/09)
-
Status badges: icon + label + text (never color-only); screen reader reads
"status {status}". -
Marks rows:
"{student}, {marks} of {max}"; errors announced; Enter saves + advances focus; Tab order stable; 48 dp targets; reduced motion halves durations. - Publish dialog: focus trap, Escape cancels, progress announced; live-region on coverage bar and publish badge flip.
- Report card table: headers announced; grade badge label with threshold text.
-
Color contrast in dark mode:
tertiaryContainerbadges, muted "not marked" rows ≥ 4.5:1.
5. Responsive & theming
- Phone (≤600 dp): stacked cards, marks rows full-width, sheets for grade/ conflict.
- Tablet (≥840 dp): master–detail list+detail; marks screen right rail; report card real table.
- Dark/light: token-only swap; published badge & coverage bar verified in both.
-
Keyboard:
Nnew exam,Ppublish (desktop); no overflow at 320 dp width.
6. Performance
- List first page < 500 ms p95 (cached); marks save round-trip < 500 ms p95.
-
Coverage tab N+1 bounded: one
GET /results/exam-subject/:idper slot, serialized or throttled ≤ 4 concurrent; no re-fetch on tab switch without change. - Marks screen with 60-student roster: no jank, row save never blocks typing.
- Report card cached 24 h when published; 5 min otherwise (13 §6).
7. Security & tenancy
-
Cross-tenant
:id→ 404, never leaks existence (base.repository.ts:20-30). -
tenantIdnever sent in bodies;x-request-idechoed (00-shared/07 §6,response-envelope.interceptor.ts:44). - No secrets in logs/screens; error UI uses server codes + i18n keys (00-shared/07 §11).
-
RBAC: when
exam.*lands (OQ-4) — 403 hides actions, read-only state, server authoritative.
8. Analytics (proposed)
- Events per 05_Screen_Inventory.md fire on: list view, row tap, create start, detail view, publish tap/success/failure, marks open/save/fail, coverage, slot add (+conflict warned), results view, report card view/share.