Skip to content

test(subscription): add unit tests for initialize and admin paths (#890) - #1299

Closed
had3sgames wants to merge 1 commit into
MyFanss:mainfrom
had3sgames:feat/890-subscription-init-admin-tests
Closed

test(subscription): add unit tests for initialize and admin paths (#890)#1299
had3sgames wants to merge 1 commit into
MyFanss:mainfrom
had3sgames:feat/890-subscription-init-admin-tests

Conversation

@had3sgames

Copy link
Copy Markdown
Contributor

Add tests for PlanCount=0 on init, initialized event emission, admin() panic on uninitialized contract, and admin address stability across fee configuration changes.

Summary

Changes

Test Plan

Automated tests added or updated

  • Unit tests (backend/src/**/*.spec.ts) — service/guard/decorator logic in isolation
  • Integration / e2e tests (backend/test/**/*.e2e-spec.ts) — HTTP round-trips with mocked infrastructure
  • Frontend component tests (frontend/src/**/*.test.{ts,tsx}) — React component behaviour
  • Frontend e2e tests (frontend/e2e/**/*.spec.ts) — Playwright browser flows
  • Contract tests (contract/) — Soroban/Rust unit tests via cargo test
  • No new tests required — explain why: ___

How to run the tests locally

# Backend unit tests
cd backend && npm test

# Backend e2e tests (requires no live DB — uses in-memory mocks)
cd backend && npm run test:e2e

# Frontend component tests
cd frontend && npx vitest run

# Frontend e2e tests (requires dev server on :3000 and API on :3001)
cd frontend && npx playwright test

# Contract tests
cd contract && cargo test

Manual verification checklist

  • Happy path works end-to-end in a local environment
  • Error / edge cases handled gracefully (stale state, invalid input, disconnected wallet)
  • No regressions in closely related API or UI flows
  • Rate-limiting, auth guards, and feature flags behave as expected where touched
  • Linting passes: cd backend && npm run lint / cd frontend && npm run lint

Related issues

Notes for reviewers

…Fanss#890)

Add tests for PlanCount=0 on init, initialized event emission, admin()
panic on uninitialized contract, and admin address stability across fee
configuration changes.
@aji70 aji70 closed this Jul 22, 2026
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