Skip to content

feat: add calculator component testing and contributor guidelines#783

Open
NoahMaizels wants to merge 3 commits intomasterfrom
add/calculator-testing
Open

feat: add calculator component testing and contributor guidelines#783
NoahMaizels wants to merge 3 commits intomasterfrom
add/calculator-testing

Conversation

@NoahMaizels
Copy link
Collaborator

  • Add AmountAndDepthCalc.test.js with 37 comprehensive unit tests
  • Cover time conversion, depth calculation, cost calculation, and data consistency
  • Update README.md with testing instructions for contributors
  • Update CODING.md with calculator testing requirements
  • Tests validate all 25 depths (17-41), 5 erasure levels, and encryption modes

- Add AmountAndDepthCalc.test.js with 37 comprehensive unit tests
- Cover time conversion, depth calculation, cost calculation, and data consistency
- Update README.md with testing instructions for contributors
- Update CODING.md with calculator testing requirements
- Tests validate all 25 depths (17-41), 5 erasure levels, and encryption modes

Contributors must run tests before submitting PRs to this component.
@netlify
Copy link

netlify bot commented Mar 19, 2026

Deploy Preview for test-twitter-preview-testing-3 ready!

Name Link
🔨 Latest commit ccf39ad
🔍 Latest deploy log https://app.netlify.com/projects/test-twitter-preview-testing-3/deploys/69bc0ba55e6a6100089f3368
😎 Deploy Preview https://deploy-preview-783--test-twitter-preview-testing-3.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

NoahMaizels and others added 2 commits March 19, 2026 19:56
- 23 test cases covering reverse calculator logic
- Validates depth/amount recovery from volume/duration inputs
- Tests input validation, storage duration calculation, volume formatting
- Tests cost calculation with exponential depth and linear amount scaling
- Tests encryption and erasure coding effects on effective volumes
- Tests edge cases (depth 17 minimum, depth 41 maximum)
- All tests passing with properly calibrated tolerances for floating-point precision

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Collected real estimates from swarm-cli (depth 17-23 with amount 1103536010)
- Updated AmountAndDepthCalc.js component with current pricing
- Updated test files with current data and extrapolated values for higher depths
- Scaled encryption/erasure levels based on historical overhead patterns
  - Unencrypted 'none' level uses current swarm-cli estimates
  - Encrypted and other erasure levels scaled to preserve cost relationships
- All 37 AmountAndDepthCalc tests passing
- All 23 VolumeAndDurationCalc tests passing

This ensures tests use current network pricing rather than stale hardcoded values.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
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.

1 participant