Fix banned user test to match new suspension message#520
Merged
Conversation
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Contributor
Greptile SummaryThis PR syncs test assertions and documentation to match an already-shipped change to the
Confidence Score: 5/5Safe to merge — purely a test and documentation sync with no logic changes. The production code was already correct; this PR only updates two test assertions and one documentation example to match it. There are no behavioral changes, no new logic, and no security implications. No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant Client
participant POST as _post.ts
participant DB as User DB
Client->>POST: POST /api/v1/chat/completions (API key)
POST->>DB: Fetch user info (id, email, banned, ...)
DB-->>POST: userInfo
alt userInfo.banned === true
POST-->>Client: 403 { error: "account_suspended", message: "Your account has been suspended..." }
else not banned
POST-->>Client: Continue with normal completion flow
end
Reviews (1): Last reviewed commit: "Update banned user test assertions to ma..." | Re-trigger Greptile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
_post.tswas updated, but the test assertions still checked the old phrasing ("due to billing issues" / "to resolve this").completions.test.tsassertions to match the current message ("Your account has been suspended" / "if you did not expect this").docs/error-schema.mdto reflect the new message.Test plan
bun test web/src/app/api/v1/chat/completions/__tests__/completions.test.tspasses the "Banned users" case.🤖 Generated with Claude Code