Skip to content

test: cover estimateSellProceeds edge cases (#403) - #1270

Merged
Chucks1093 merged 1 commit into
accesslayerorg:devfrom
uche001-dev:fix/403-link-sell-proceeds-helper
Oct 27, 2026
Merged

Chucks1093 merged 1 commit into
accesslayerorg:devfrom
uche001-dev:fix/403-link-sell-proceeds-helper

Conversation

@uche001-dev

Copy link
Copy Markdown

Summary

closes #403

#403 (sell proceeds estimate helper) was already implemented and merged via #419, but #419 targeted main instead of dev, so its closes tag never auto-closed the issue even though estimateSellProceeds is already on dev.

The helper shipped with no dedicated unit tests, so this adds that missing coverage rather than a no-op verification PR.

Changes

  • Added a describe block for estimateSellProceeds in keyPriceDisplay.utils.test.ts covering the happy path (price * quantity) and every guard clause: null/undefined key price, null/undefined current supply, zero/negative sell quantity, and non-finite inputs (NaN/Infinity).

Test plan

  • npx vitest run src/utils/tests/keyPriceDisplay.utils.test.ts: 15/15 passing (6 new).
  • prettier and eslint clean on the changed file.

estimateSellProceeds (added in accesslayerorg#419) shipped with no dedicated test
coverage. accesslayerorg#419 merged into main instead of dev, so its closes tag never
auto-closed the issue even though the helper is already on dev.

Adds coverage for the happy path and every null/invalid-input guard
clause: missing key price, missing current supply, non-positive sell
quantity, and non-finite values.

Closes accesslayerorg#403
@Chucks1093

Copy link
Copy Markdown
Member

✅ PR Ready for Review

Due to a recent malware incident affecting our repositories, all PRs are required to pass automated security checks before being reviewed for merging.

This PR has passed all automated checks:

  • ✅ Security scan — no malicious code detected
  • ✅ No merge conflicts
  • ✅ CI checks passed

Next step: Please share this PR link in our Telegram group so a maintainer can review and merge it: https://t.me/c/accesslayerorg/8514

@Chucks1093
Chucks1093 merged commit 294b517 into accesslayerorg:dev Oct 27, 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 helper for displaying sell proceeds estimate before confirmation

2 participants