Feat/admin tests 62 63 64#102
Merged
Merged
Conversation
#63) - server.test.ts: missing payload/bad signature/stale auth_date → 401, empty ADMIN_TELEGRAM_IDS → 503; refactored signedInitData via buildInitData helper - adminStore.test.ts: new file — 14 unit tests for adjustBalance covering credit/debit/set happy paths, player sync, balance_event skip on delta=0, audit via SQL and via auditLog, not_found/invalid_input/conflict error cases
Stats: default 24h window, 30d window, invalid window 400, response shape. User search: query passthrough, empty result. User detail: found 200, not_found 404, missing accountId 400. Audit: events array, filter passthrough, invalid operation 400. Balance adjust errors: not_found 404, conflict 409, invalid balance kind 400. Admin backend unavailable: no adminStore configured 503.
ilyar
approved these changes
May 22, 2026
Member
ilyar
left a comment
There was a problem hiding this comment.
Reviewed together with PR #101 and PR #103.
This PR is a good base layer for the later P2E/backend work: it only adds payments/admin tests, covers admin auth, balance adjustments, stats/search/detail/audit endpoints, and the verify check is green.
Important dependency note: PR #103 already includes these two commits, so merge this PR first, then rebase/update PR #103 so its diff contains only the P2E/schema work.
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.
No description provided.