Skip to content

test: add regression coverage for RiskScoreWeights failure handling - #1232

Merged
thlpkee20-wq merged 1 commit into
RevoraOrg:masterfrom
priscannanna85-lgtm:fix/issue-960-add-regression-coverage-for-riskscoreweights
Sep 29, 2026
Merged

thlpkee20-wq merged 1 commit into
RevoraOrg:masterfrom
priscannanna85-lgtm:fix/issue-960-add-regression-coverage-for-riskscoreweights

Conversation

@priscannanna85-lgtm

Copy link
Copy Markdown
Contributor

Overview

This PR adds focused regression coverage for the RiskScoreWeights failure path in src/aml/riskScoreEngine.ts, where a dual-control confirmation is required before risk weights can be changed. It exercises the thrown error contract, the neighboring success path, and boundary inputs, and makes the failure behavior deterministic and observable.

Related Issue

Changes

🧪 RiskScoreWeights regression coverage

  • [MODIFY] src/aml/riskScoreEngine.ts

    • Ensured the dual-control failure branch is reachable and deterministic so it can be asserted in tests, while preserving the existing public contract (same error message and thrown Error type).
  • [ADD] src/aml/riskScoreEngine.test.ts

    • Regression test asserting that changing risk weights without dual-control confirmation throws Error('Dual-control confirmation is required to change risk weights').
    • Success-path test asserting that a valid, confirmed weight change is applied and returned as expected.
    • Boundary tests covering edge inputs (e.g. empty/zero/limit weight values) to confirm the branch behavior stays observable and stable.

Verification Results

npm test -- src/aml/riskScoreEngine.test.ts
✅ focused suite passed

npm test
✅ surrounding suite passed
Acceptance Criteria Status
Cover the named behavior with focused automated tests, including success and failure paths ✅ Failure (dual-control required) and success (confirmed change) paths covered
Preserve the existing public contract ✅ Same error type/message and return shape retained
Make error and boundary behavior observable and deterministic ✅ Explicit assertions on thrown error and boundary inputs

Closes #960

@drips-wave

drips-wave Bot commented Sep 29, 2026

Copy link
Copy Markdown

@priscannanna85-lgtm 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

@thlpkee20-wq
thlpkee20-wq merged commit c9d4102 into RevoraOrg:master Sep 29, 2026
1 check 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.

Add regression coverage for RiskScoreWeights failure handling

2 participants