14 — QA Checklist (Homework Module)
- 1. Functional (server-contract mirrors)
- 2. Visual / layout
- 3. Accessibility (00-shared/09)
- 4. Performance
- 5. Offline & network (00-shared/10 §2)
- 6. Tablet / desktop
- 7. Localization
- 8. Permissions
- 9. Dark mode
- 10. Animations
- 11. Security
- 12. Server-backed edge mirrors
- QA scripts
Module QA specific to framework + shared 00-shared/10. Every check derives from a specific backend behavior so failure analysis is direct.
1. Functional (server-contract mirrors)
-
Create homework with all fields → 201 doc with
status:'active',assignedDateset (homework.service.ts:30-32); e2e baselinetest/p1-operations.e2e-spec.ts:285-301. -
Create without
title/dueDate/non-MongoId refs → 400VALIDATION_ERROR(homework.dto.ts:4-33). -
Class list returns array sorted
dueDatedesc (homework.repository.ts:20). -
Detail: known id → 200; unknown → 404 "Homework not found." (
homework.service.ts:47). -
Update: only
title/description/attachments/dueDate/statusaccepted;classId/subjectId/teacherIdin PATCH body are ignored (not in DTO,homework.dto.ts:35-58) — verify no crash. -
Delete → 200; the doc disappears from class list (soft delete +
isDeletedfilter,base.repository.ts:68-74); submissions remain in DB (no cascade). -
Due-date/timezone: create with
dueDateISO incl. timezone offset; list shows correct local date. Submit after dueDate → 201 (server accepts — OQ-1); client late badge shows. Submit before due → no late badge. -
Duplicate submission: second
POST /homework/:id/submitfor same (studentId, homeworkId) → 409DUPLICATE_RESOURCE"Already submitted." (homework.service.ts:92); also covered by unique index (homework-submission.schema.ts:37-40) — verify direct DB insert is rejected. - Resubmission rules: no resubmit path exists — after 409 the UI must show the info state, never allow editing the submission (OQ-1 note).
-
Regrading: grade twice → 200 both times; second call overwrites marks,
resets
gradedAt, emits secondHomeworkGraded(homework.service.ts:127-143); UI shows regrade warning. -
Grade unknown submission → 404 "Submission not found." (
homework.service.ts:126). -
Marks edge: server accepts
-5and9999(no decorator,submission.dto.ts:20-21— OQ-4); client must reject/limit; verify client is the only guard today. -
status:'closed'homework: submit and grade still succeed server-side (no enforcement — OQ-3); UI communicates closure but doesn't claim blocking. -
Attachment limits:
POST /files/uploadhas no size/mime limit in code (files.controller.ts:29-41) — client enforces (max 25 MB, doc types); verify oversized file → client-side rejection message. -
Attachment download returns stream with correct
Content-Disposition(files.controller.ts:55-64); deleted file → 404 → snackbar. -
In-app notification for homework events:
event-queue-map.ts:22-25routes exist; known gap:NotificationTypeenum lacks the event types (notification.schema.ts:7-12) → notification create fails validation (inapp.worker.ts:46-53). QA: assert queue job lands; mark notification persistence as(planned)until enum fix (OQ-8).
2. Visual / layout
- Cards/badges at 200% text scale no clipping (title maxLines 2, meta wraps).
- Dark-light parity: status chips, late badge, grade card, upload progress.
-
Marks in
monotabular figures align in lists. -
Long titles + long file names wrap gracefully;
SelectableTexton detail.
3. Accessibility (00-shared/09)
- TalkBack: list → detail → submit flow; grade flow; attachment upload announced ("Uploading Algebra.pdf, 45%").
- VoiceOver separately; NVDA on web/desktop.
-
Keyboard-only: create form tab order,
Ctrl+Entersubmit,Esccloses sheets. - Late badge readable as text, not color-only.
- Errors announced on focus; focus to first invalid field on submit.
- Contrast 4.5:1 body / 3:1 chrome both modes.
4. Performance
- List first frame < 300 ms cached; network content ≤ 2 s (00-shared/10 §1).
-
No duplicate parallel requests: detail (teacher) fetches homework + submissions
in one
Future.wait; student per-card submissions fetch coalesced(proposed: single endpoint). -
Upload of 25 MB file doesn't jank UI (progress updates throttled,
m-instant).
5. Offline & network (00-shared/10 §2)
- List renders cached + offline banner; pull-to-refresh blocked gracefully.
- Submit/grade/create offline → blocked with guidance; draft preserved.
- Network loss mid-upload → per-file pending/retry, no silent corruption.
- Network loss after submit request sent but before response → on retry, 409 path shows "Already submitted" (never duplicate server records).
- 429 (rapid actions/uploads) → countdown, no auto-retry.
6. Tablet / desktop
- Master-detail list+detail ≥ 840 dp; grade sheet split view ≥ 1200 dp.
- Hover states on cards/rows; right-click menu == long-press menu.
-
Nshortcut (new homework) on list;Tabtraversal in grade sheet.
7. Localization
-
All strings via i18n keys (
homework.*); date/time viaIntllocale; due-date formatting respects org locale/timezone. - Long German/Hindi/Spanish smoke strings don't break badges/cards.
8. Permissions
-
Homework endpoints currently JWT-only (
homework.controller.ts:19) — verify cross-role calls succeed server-side; client role-gates UI (OQ-9). -
file.upload/file.readrequired on files endpoints (files.controller.ts:30,44): a JWT without these perms gets 403PERMISSION_DENIED→ upload disabled in UI. -
When
homework.*perms land (blueprint Homework.md:66-71), re-run matrix: create/update/delete/submit/grade gating.
9. Dark mode
- Full visual pass: badges, grade card, upload tiles, dialogs; contrast re-checked.
10. Animations
- Tokens only; reduced-motion = fades/instants; no shake on duplicate-409.
11. Security
-
No homework/student data in logs/analytics beyond event payloads (already
minimal: ids only,
homework.service.ts:40,65,79,105-109,142). - Uploads never auto-preview executable types; download opens via share sheet.
-
studentIdin submit body is client-filled — flag: server does not bind it to the JWT subject (OQ-9) → verify product decision (student can submit on behalf of any id).
12. Server-backed edge mirrors
- 404 after homework deleted → empty state "removed" (detail + submissions).
-
CastError on malformed id → 400
VALIDATION_ERROR"Invalid resource identifier." (http-exception.filter.ts:47-55,91-92). -
Double-tap submit → single server record + one
HomeworkSubmittedjob (queue idempotencyqueue-bridge.service.ts:44-46).
QA scripts
- Golden per component (light/dark × phone/tablet/desktop × key states).
- E2E (device cloud P0): teacher creates w/ attachment → student submits (with file) → teacher grades → student sees grade → duplicate submit shows info state.
- Upload matrix: 0 B file, 25 MB boundary, wrong mime, mid-flight network kill, retry.
- Notification pipeline: enqueue
HomeworkGraded→ assert in-app job; monitor enum gap (OQ-8).