Skip to content

Dedupe seminar attendance test helpers - #139

Merged
buzz-code merged 1 commit into
mainfrom
claude/year-start-august-s6zrjt
Aug 18, 2026
Merged

buzz-code merged 1 commit into
mainfrom
claude/year-start-august-s6zrjt

Conversation

@buzz-code

Copy link
Copy Markdown
Owner

Summary

Follow-up cleanup on yemot-handler.service.test.ts after #138, per review feedback that the seminar-attendance test helpers were repeating text/boilerplate.

  • rejectKlass() now reuses askForKlass() instead of duplicating the .systemAsks(/enter klass number/i).userResponds(klassKey) literal — askForKlass had dropped to a single real caller (entersKlass) after the prior refactor, so this gives it two genuine callers instead of leaving it as unnecessary indirection.
  • Added a seminarBuilder() factory for the User/Teacher/Klass/Student/StudentKlass/Text seed combo that was repeated verbatim across 7 of the 10 seminar-attendance tests (only klass/permissions/trailing seeds varied). The 3 tests that deliberately seed a narrower set (no recognized teacher, no roster, custom AttReport) keep their own explicit builder.

Net: -26 lines, no behavior change.

Testing

Full server suite: 100 suites / 941 tests passing.


🤖 Generated with Claude Code


Generated by Claude Code

- rejectKlass() now reuses askForKlass() instead of duplicating the ask+respond literal
- Add seminarBuilder() factory for the User/Teacher/Klass/Student/StudentKlass/Text seed
  combo repeated across most seminar-attendance tests

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MX2QnzzPvash7UmemgUPL9
Copilot AI lite review requested due to automatic review settings August 18, 2026 06:06
@buzz-code
buzz-code merged commit 624625a into main Aug 18, 2026
1 check passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Cleanup seminar-attendance IVR test helpers in YemotHandlerService Jest suite. Reduce repeated scenario-step + seed boilerplate, keep behavior same.

Changes:

  • rejectKlass() now reuses askForKlass() step helper
  • Add seminarBuilder() factory for common recognized-teacher + klass-roster seed set, update multiple seminar tests to use it

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants