Skip to content

API tests: fix the poll close test that two merges broke (api-tests is red on main) - #4446

Closed
pdcarlson wants to merge 1 commit into
mainfrom
claude/fix-poll-close-test
Closed

pdcarlson wants to merge 1 commit into
mainfrom
claude/fix-poll-close-test

Conversation

@pdcarlson

Copy link
Copy Markdown
Owner

Summary

api-tests is red on main, and so on every open PR. The failing test is PollService › close › a chat-card poll › lets a moderator close an open-ended card whose creator can no longer close it, keeping the tally (#4046), which throws BadRequestException: Cannot close a deleted poll.

Two PRs collided:

In the test, updateIfLive returns nothing, so the close reads as "deleted".

The fix mocks and asserts updateIfLive, as every other card-path test in the file already does. The REST-shape moderator test keeps update, which is right because the REST path still writes through it. Nothing else changes.

Found while babysitting #4445, which this unblocks. Asked by: Shawn, 2026-11-12, as part of #3774's work (coordinator chat on Paul's second account).

Changes

  • apps/api/src/application/services/poll.service.spec.ts: one test's mock and its assertion.

Docs / Spec impact

  • Docs impact: None
  • Spec impact: None

Test plan

  • Reproduced on main (304501b): npx jest src/application/services/poll.service.spec.ts gives 1 failed, 78 passed.
  • With the fix: 79 passed.
  • CI api-tests green.

/diff-review: one finder ran over the 5-line diff and found nothing. That is a smaller round than the full workflow, because the change is test-only.

Release label

release:patch

Debt spotted

None found.


Generated by Claude Code

#4390's moderator-close test mocked messageRepo.update, but #4421 (merged
separately) made closeCard write through updateIfLive, so the test's write
returned undefined and closeCard threw 'Cannot close a deleted poll'.
api-tests has been red on main since.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D7R7NNPw2Kpjnca1FFPvfH
@pdcarlson pdcarlson added the release:patch Bump patch version on merge to main (default) label Nov 12, 2026 — with Claude
@github-actions

Copy link
Copy Markdown

Base-branch sync — main moved to 929cf05 and this PR now has merge conflicts with it.

If you are the agent session watching this PR, resolve them now:

  1. git fetch origin main
  2. git merge origin/main on this PR's branch
  3. Resolve the conflicts — keep both sides' behavior; only ask when a conflict is genuinely ambiguous (both sides changed the same logic and picking one loses behavior).
  4. Run the checks you can locally, then push. Your push re-runs CI against the new base.

Automated wake signal from pr-base-sync.yml (docs/ci-cd/pr-babysitting.md § Base-branch sync): posted fresh (never edited) on each base move so created-only webhook listeners fire. One live comment per PR — a later sweep removes it once the PR is back in sync with its base.

Copy link
Copy Markdown
Owner Author

Closing: main now carries the same fix (929cf05, via #4386, mocks and asserts updateIfLive in this test), which is why this PR conflicts. Nothing is left for it to do.


Generated by Claude Code

@pdcarlson pdcarlson closed this Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release:patch Bump patch version on merge to main (default)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants