Skip to content

test: add component tests for create-form validation and unlock-chart SVG render - #712

Open
simeontech wants to merge 1 commit into
FlowwStar:mainfrom
simeontech:test/component-tests-653-654
Open

test: add component tests for create-form validation and unlock-chart SVG render#712
simeontech wants to merge 1 commit into
FlowwStar:mainfrom
simeontech:test/component-tests-653-654

Conversation

@simeontech

Copy link
Copy Markdown

Summary

Adds component tests for two open issues, both isolated from e2e coverage.


#653 — Component tests for create-form.tsx client-side validation

File: __tests__/components/create-form.test.tsx

Tests the validate() logic inside CreateForm in full isolation using React Testing Library. All heavy dependencies (hooks, contract lib, Next.js navigation, child components) are mocked.

Test What it covers
Required fields empty Shows invalidAddressFormat + invalidAmount errors on submit
Invalid recipient address Shows invalidAddressFormat error; no amount error
Cliff amount exceeds total Shows cliffExceedsTotal error when cliffAmount > amount

#654 — Component tests for full SVG render of unlock-chart.tsx

File: __tests__/components/unlock-chart-render.test.tsx

Renders the full UnlockChart component with both fixture types and asserts the expected SVG structure. Complements the already-merged toX()/toY() unit tests.

Test What it covers
No-cliff stream — SVG present role="img" element renders
No-cliff stream — unlock path <path stroke-width="2"> present
No-cliff stream — no cliff line No <line stroke-dasharray="4 3">
No-cliff stream — no Cliff legend queryByText('Cliff') returns null
Cliff stream — SVG present role="img" element renders
Cliff stream — unlock path <path stroke-width="2"> present
Cliff stream — cliff line <line stroke-dasharray="4 3"> present
Cliff stream — Cliff legend getAllByText('Cliff') returns results

Test results

Test Files  2 passed (2)
Tests       11 passed (11)

Closes #653
Closes #654

… SVG render

Closes FlowwStar#653 — adds __tests__/components/create-form.test.tsx covering:
- required fields empty shows recipient + amount errors
- invalid recipient address shows address-format error
- cliff amount > total amount shows cliff-exceeds-total error

Closes FlowwStar#654 — adds __tests__/components/unlock-chart-render.test.tsx covering:
- no-cliff stream: SVG renders, unlock path present, no cliff line/legend
- cliff stream: SVG renders, dashed cliff indicator line and Cliff legend present

All 11 tests pass.
@drips-wave

drips-wave Bot commented Aug 30, 2026

Copy link
Copy Markdown

@simeontech 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant