Spec 14 Testing and Definition of Done - SekiroKenjii/Quizzivy GitHub Wiki

Section of Quizzivy โ€” Frontend Portal & Data Model Specification ยท Previous ยท Next

14. Testing & definition of done

Unit (Vitest): zod schemas, utils, take-test store (timer math, resume merge, submit idempotency), integrity buffering and strike counting, join-code normalization, audio plays-remaining reconciliation.

Component (Testing Library): each form validates and submits; guards redirect correctly; a renderer test per QuestionType; integrity dialog states; audio player states (idle / playing / plays exhausted / seek blocked / load error).

E2E (Playwright + MSW or a seeded backend):

  1. Admin logs in โ†’ creates a test with one of each question type including audio โ†’ publishes โ†’ assigns.
  2. Student logs in with password โ†’ starts โ†’ answers โ†’ reloads mid-test โ†’ answers persist โ†’ submits โ†’ sees result.
  3. Join flow: anonymous visitor opens /join/:code โ†’ sees class name โ†’ Google sign-in (mocked GIS) โ†’ account created, enrolled, lands on /app.
  4. Expired code โ†’ plain error, no account created, nothing leaked about the class.
  5. Timer expiry auto-submits.
  6. Tab-switch fires tab_hidden, warning dialog appears, event lands on the admin integrity timeline.
  7. Second tab on the same attempt supersedes the first; the first goes read-only.
  8. Audio maxPlays: play twice โ†’ play button disabled โ†’ reload โ†’ still disabled (server-authoritative).
  9. Student payload assertion: GET /app/attempts/:id contains no isCorrect, sampleAnswer, transcript, or acceptedAnswers.

Definition of done for any task:

  • TypeScript strict passes; no any without a comment
  • Lint clean
  • Loading / error / empty states present
  • All strings via t(), keys in both vi and en
  • Keyboard-operable
  • Tests added/updated per the levels above
  • Any DDL reviewed against ยง13 and the Neon skill
  • Any new public (unauthenticated) endpoint is rate-limited and leaks nothing (ยง6.5)
  • No new dependency without a stated reason in the PR description

Section of Quizzivy โ€” Frontend Portal & Data Model Specification ยท Previous ยท Next


Generated from docs/quizzivy-spec-v0.3.md. Edit that file in the repository; changes made on this page are overwritten.

โš ๏ธ **GitHub.com Fallback** โš ๏ธ