Skip to content

Feat/admin tests 62 63 64#102

Merged
ilyar merged 2 commits into
mainfrom
feat/admin-tests-62-63
May 22, 2026
Merged

Feat/admin tests 62 63 64#102
ilyar merged 2 commits into
mainfrom
feat/admin-tests-62-63

Conversation

@michael-88944
Copy link
Copy Markdown
Contributor

No description provided.

#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.
Copy link
Copy Markdown
Member

@ilyar ilyar left a comment

Choose a reason for hiding this comment

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

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.

@ilyar ilyar merged commit d7bebce into main May 22, 2026
1 check passed
@ilyar ilyar deleted the feat/admin-tests-62-63 branch May 22, 2026 13:53
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