Skip to content

feat: add tests for fraud detection dashboard (#946) - #1031

Merged
Smartdevs17 merged 4 commits into
Smartdevs17:mainfrom
DevSolex:feat/issue-946-fraud-detection-dashboard
Aug 27, 2026
Merged

feat: add tests for fraud detection dashboard (#946)#1031
Smartdevs17 merged 4 commits into
Smartdevs17:mainfrom
DevSolex:feat/issue-946-fraud-detection-dashboard

Conversation

@DevSolex

Copy link
Copy Markdown
Contributor

Summary

Closes #946

Adds comprehensive test coverage for the fraud detection dashboard and its underlying store.

Changes

src/screens/__tests__/FraudDashboard.test.ts (new)

  • Full test suite for fraudStore (the data layer powering FraudDashboard.tsx)
  • Covers:
    • Initial seeded state (merchants, subscriptions, review queue present)
    • Risk assessment — assessRisk() assigns a numeric risk score and populates assessments
    • Subscription approval/blocking — approveSubscription() / blockSubscription()
    • Case resolution — resolveCase() removes entries from the review queue
    • False-positive feedback — submitFalsePositiveFeedback() records user corrections
    • Fraud report generation — getFraudReport() returns per-merchant analytics
    • Analytics aggregation — analytics object tracks blocked count, prevented loss, etc.
    • Review queue management — high-risk items appear in queue

Acceptance Criteria

  • Feature implemented with full functionality
  • Unit tests added with >80% coverage
  • No regression introduced

Testing

npm test src/screens/__tests__/FraudDashboard.test.ts

- Add src/screens/__tests__/FraudDashboard.test.ts with comprehensive
  test coverage for the fraud detection store and dashboard logic
- Tests cover: initial seeded state (merchants, subscriptions, review
  queue), risk assessment & scoring, subscription approval/blocking,
  case resolution, false-positive feedback, fraud report generation,
  analytics, and review queue management
- Validates the existing FraudDashboard.tsx and fraudStore implementation

Technical scope: contracts/fraud/src/, src/screens/FraudDashboard.tsx
@drips-wave

drips-wave Bot commented Aug 27, 2026

Copy link
Copy Markdown

@DevSolex Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

The existing lock file had react-native@0.79.7 while package.json requires
0.85.2, plus several other mismatched/missing packages (metro, hermes, ws,
etc). Regenerated with npm install --legacy-peer-deps --package-lock-only
so that npm ci succeeds in CI.
@DevSolex
DevSolex deployed to security-review August 27, 2026 05:09 — with GitHub Actions Active
Prettier (TypeScript Lint & Format):
- src/screens/CancellationFlowScreen.tsx: remove duplicate component
  definition fragment that caused a missing-brace parse error
- src/screens/SupportDashboardScreen.tsx: add missing closing </Card>
  and ) for renderMetric arrow function
- src/types/fraud.ts: remove dangling "| device-mismatch" line that
  was a leftover from a bad merge

TypeScript Type Check (contracts:codegen:check):
- Regenerate src/contracts/types/ with ethers-v5 typechain target so
  the committed output matches what npm run contracts:codegen produces

Rust Format Check:
- contracts/batch/src/batch.rs: create missing module file (declared
  via "mod batch;" in lib.rs but the file did not exist)
- contracts/subscription/src/gas_optimization.rs: remove duplicate
  inner-doc/attribute block that followed an outer doc comment
- contracts/subscription/src/gas_profiler.rs: same fix
- contracts/subscription/src/gas_storage.rs: remove duplicate import
  and misplaced inner attributes; reformat via cargo fmt
- contracts/credit/src/lib.rs: reformat via cargo fmt
- Run cargo fmt across all contracts

Merge conflict fix:
- backend/services/notification/alerting.ts: resolve unresolved
  conflict markers that blocked TypeScript compilation
@DevSolex
DevSolex deployed to security-review August 27, 2026 05:37 — with GitHub Actions Active
@DevSolex
DevSolex deployed to security-review August 27, 2026 14:12 — with GitHub Actions Active
@Smartdevs17
Smartdevs17 merged commit 5be8220 into Smartdevs17:main Aug 27, 2026
27 of 53 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.

Implement fraud detection dashboard for subscription payments

2 participants