Skip to content

Add tests for reaction-based PR merge handler#18

Open
rossnelson wants to merge 3 commits intomainfrom
claude/1774913464-766059
Open

Add tests for reaction-based PR merge handler#18
rossnelson wants to merge 3 commits intomainfrom
claude/1774913464-766059

Conversation

@rossnelson
Copy link
Copy Markdown
Member

Summary

  • Adds unit tests for the :approved: → merge → :merged: reaction handler introduced in Add reaction-based PR merge flow #17
  • 11 test cases covering all paths: happy path, error cases, edge cases

Test plan

  • npx vitest run src/bot/events/__tests__/reaction.test.ts — 11/11 passing

Replace the deploy command's auto-cleanup with a reaction-driven workflow:
- New reaction handler listens for :approved: on root thread messages
- Merges the associated PR, adds :merged: reaction, then cleans up
- Deploy command now only creates the PR (workspace stays alive for merge)
- Add TypeScript to runtime Docker image
Tests cover: ignoring non-approved reactions, missing sessions,
missing PR mappings, missing workspaces, already-merged/closed PRs,
happy path merge flow, and merge failure error handling.
- Update expected args: --allowedTools * → --model sonnet
- Save/restore env vars (CLAUDE_MODEL, CLAUDE_CODE_OAUTH_TOKEN) so
  tests hit the intended code paths
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.

2 participants