Skip to content

feat: extract testable diagnostics report builder with healthy/failing fixtures - #199

Merged
El-swaggerito merged 1 commit into
Aegis-RWA:mainfrom
Carlys17:feat/dashboard-diagnostics-page-181
Jul 30, 2026
Merged

feat: extract testable diagnostics report builder with healthy/failing fixtures#199
El-swaggerito merged 1 commit into
Aegis-RWA:mainfrom
Carlys17:feat/dashboard-diagnostics-page-181

Conversation

@Carlys17

Copy link
Copy Markdown
Contributor

Summary

Extract the diagnostics report-building logic into a pure, testable function and add unit tests covering healthy, failing, and mock-mode states.

Changes

  • buildReport.ts: New pure function buildDiagnosticsReport() that assembles a redacted, copyable diagnostics report and status cards from runtime inputs. All sensitive values (RPC URL paths, contract IDs, wallet addresses) are redacted via the shared redact helpers.
  • DiagnosticsPanel.tsx: Refactored to use buildDiagnosticsReport(), replacing ~60 lines of inline report/card logic with a single call.
  • buildReport.test.ts: Unit tests covering healthy state (all ok), failing state (config errors, missing RPC/contract, no wallet), and mock mode (all warnings).
  • docs/diagnostics.md: Updated to reference the builder and test fixtures.

Testing

  • npx vitest run src/lib/diagnostics/ — 9 tests pass (6 redact + 3 buildReport)

Closes #181

…g fixtures

- Extract buildDiagnosticsReport() pure function to src/lib/diagnostics/buildReport.ts
- Refactor DiagnosticsPanel to use the builder, reducing inline logic
- Add unit tests covering healthy, failing, and mock-mode states
- Update docs/diagnostics.md to reference the builder and test fixtures

Closes #181
@El-swaggerito
El-swaggerito merged commit cc4dba0 into Aegis-RWA:main Jul 30, 2026
2 checks passed
@grantfox-oss grantfox-oss Bot mentioned this pull request Jul 30, 2026
6 tasks
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 Aegis dashboard diagnostics page

2 participants