Skip to content

test: Add dashboard test fixture framework - #51

Open
Favouratambi wants to merge 1 commit into
Raegis-RWA:mainfrom
Favouratambi:feat/test-fixture-framework
Open

test: Add dashboard test fixture framework#51
Favouratambi wants to merge 1 commit into
Raegis-RWA:mainfrom
Favouratambi:feat/test-fixture-framework

Conversation

@Favouratambi

Copy link
Copy Markdown

Closes #20

Summary

Adds a reusable test fixture framework with 6 fixture modules, 40 tests, Jest infrastructure, and documentation.

Test infrastructure

  • Jest 29 + ts-jest + jest-environment-jsdom
  • Path alias support (@/ -> src/)
  • npm test and npm run test:watch scripts

Fixture modules (src/fixtures/)

Module Fixtures Purpose
wallet.ts 7 fixtures Connected, disconnected, connecting, unknown network, edge cases
compliance.ts 4 fixtures + mock Whitelisted, not whitelisted, revoked, pending, mock checker
assets.ts 6 fixtures CRE, T-Bill, zero balance, large balance, fractional, default portfolio
portfolio.ts 4 fixtures Standard, empty, single asset, many assets (12-item grid stress test)
transactions.ts 5 fixtures Transfer success, mint success, pending, failed, failed-not-whitelisted
errors.ts 11 fixtures Wallet (2), network (2), contract (4), validation (2), unknown (1)

All fixtures use non-real address patterns (FOR-FIXTURE-ONLY). No secrets or real keys.

Tests (40 total, 6 suites)

  • wallet.test.ts — 5 tests: address/network validation, state checks
  • compliance.test.ts — 7 tests: whitelist states, mock checker edge cases
  • assets.test.ts — 8 tests: balance values, uniqueness, edge cases
  • portfolio.test.ts — 6 tests: asset counts, tickers, address patterns
  • transactions.test.ts — 6 tests: status values, error messages, hash presence
  • errors.test.ts — 8 tests: codes, messages, categories, uniqueness, no secrets

Documentation

  • docs/test-fixtures.md — full reference with fixture tables, usage examples, conventions, and guide for adding new fixtures

Other changes

  • .gitignore updated (was only .idea/; now excludes node_modules/, .next/, out/, .env*.local)
  • package.json updated with test scripts and dev dependencies
  • README.md updated with testing section

- Add Jest + ts-jest + @testing-library/react test infrastructure
- Create 6 fixture modules: wallet, compliance, assets, portfolio,
  transactions, errors with typed interfaces
- Add 40 tests across 6 test suites validating all fixtures
- Add docs/test-fixtures.md with full fixture reference and usage guide
- Fix .gitignore to exclude node_modules, .next, out, .env*.local
- Update README with testing section and fixture guide link
- Update package.json with test scripts and dev dependencies

Closes #20
@El-swaggerito

Copy link
Copy Markdown
Contributor

@Favouratambi please resolve and fix merge conflicts

@El-swaggerito

Copy link
Copy Markdown
Contributor
\nGitHub has not finished calculating whether this PR can be merged cleanly.\n\nThe auto-merge automation will skip this PR for now. Re-run the automation later.

@El-swaggerito

Copy link
Copy Markdown
Contributor
\nThis PR is currently blocked by merge conflicts.\n\nPlease update the branch with the latest main branch and resolve the conflicts before it can be merged.

@El-swaggerito

Copy link
Copy Markdown
Contributor

@Favouratambi please resolve and fix merge conflicts

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.

Add dashboard test fixture framework

2 participants