Skip to content

test(backend): refactor token transfer failure tests with helper functions - #167

Merged
ONEONUORA merged 4 commits into
Fracverse:masterfrom
martinvibes:token_transfer
Feb 24, 2026
Merged

test(backend): refactor token transfer failure tests with helper functions#167
ONEONUORA merged 4 commits into
Fracverse:masterfrom
martinvibes:token_transfer

Conversation

@martinvibes

Copy link
Copy Markdown
Contributor

Description

  • Extract token generation logic into generate_user_token() helper function
  • Extract user setup with KYC approval into setup_user_with_kyc() helper function
  • Extract plan request body creation into plan_request_body() helper function
  • Extract HTTP request building into build_create_plan_request() helper function
  • Rename test from plan_creation_rolls_back_on_transfer_revert() to revert_rolls_back_plan_insert() for clarity
  • Add comprehensive test coverage for rollback scenarios: audit logs, notifications, and plan logs
  • Improve code organization with section comments (Helpers, Tests)
  • Enhance SQL query formatting for readability
  • Reduce test duplication by centralizing common setup and request building logic

closes #108

…tions

- Extract token generation logic into `generate_user_token()` helper function
- Extract user setup with KYC approval into `setup_user_with_kyc()` helper function
- Extract plan request body creation into `plan_request_body()` helper function
- Extract HTTP request building into `build_create_plan_request()` helper function
- Rename test from `plan_creation_rolls_back_on_transfer_revert()` to `revert_rolls_back_plan_insert()` for clarity
- Add comprehensive test coverage for rollback scenarios: audit logs, notifications, and plan logs
- Improve code organization with section comments (Helpers, Tests)
- Enhance SQL query formatting for readability
- Reduce test duplication by centralizing common setup and request building logic
@ONEONUORA

Copy link
Copy Markdown
Contributor

@martinvibes Make your implementation to pass CI checks

@ONEONUORA

Copy link
Copy Markdown
Contributor

@martinvibes Pls resolve conflict

@ONEONUORA ONEONUORA left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice implementation @martinvibes

@ONEONUORA
ONEONUORA merged commit 6f2821e into Fracverse:master Feb 24, 2026
2 checks passed
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.

[Backend] Token Transfer Failure Rollback

2 participants