Skip to content

Commit e37a610

Browse files
authored
Merge pull request #924 from emwulrd/fix/issues-864-865-866-867-tests-modals-settings
Fix/issues 864 865 866 867 tests modals settings
2 parents 72e619e + a3f7113 commit e37a610

1 file changed

Lines changed: 73 additions & 0 deletions

File tree

issue.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
#867 [Testing] Add unit tests for TopUpModal (precision-filtered input, validation, new-total preview)
2+
Repo Avatar
3+
LabsCrypt/flowfi
4+
Telegram (ask questions / claim the issue here first): https://t.me/+DOylgFv1jyJlNzM0
5+
6+
Why this matters
7+
frontend/src/components/stream-creation/TopUpModal.tsx has untested behavior: the onChange regex/precision filter that rejects non-numeric and >7-decimal input, validateAmountInput + hasValidPrecision in validate(), the newTotal = currentDeposited + parsedAmount preview, and Enter-to-confirm. No test file references TopUpModal.
8+
9+
Acceptance criteria
10+
Test that non-numeric and over-precision keystrokes are rejected by the input
11+
Test that Confirm is blocked and an error shows for empty/invalid/over-precision amounts
12+
Test that the new-total preview only appears for a positive amount and equals currentDeposited + amount
13+
Test that onConfirm is called with (streamId, amount) on confirm/Enter
14+
Files to touch
15+
frontend/src/components/stream-creation/TopUpModal.tsx
16+
Out of scope
17+
Soroban top-up transaction wiring
18+
19+
20+
#866 [Testing] Add unit tests for ScheduleStep rate calculation and preview rendering
21+
Repo Avatar
22+
LabsCrypt/flowfi
23+
Telegram (ask questions / claim the issue here first): https://t.me/+DOylgFv1jyJlNzM0
24+
25+
Why this matters
26+
frontend/src/components/stream-creation/ScheduleStep.tsx has untested logic: totalSeconds via SECONDS_PER_UNIT, ratePerSecond = amount/totalSeconds, the formattedRate sec/min/hr buckets, and the ratePerDayPreview currency formatting. components.test.tsx covers RecipientStep/AmountStep/CancelConfirmModal but ScheduleStep has no test.
27+
28+
Acceptance criteria
29+
Test ratePerSecond/total-seconds for at least seconds, days, and months units
30+
Test that EURC uses a Euro symbol (not $) and XLM uses the token suffix in the rate/day preview
31+
Test that zero/empty amount or duration renders no rate preview
32+
Test the sec vs /min vs /hr formatting threshold branches
33+
Files to touch
34+
frontend/src/components/stream-creation/ScheduleStep.tsx
35+
Out of scope
36+
Full StreamCreationWizard integration test
37+
38+
#864 [Frontend] StreamDetailsModal & CancelConfirmModal render raw token amounts; remaining uses float subtraction
39+
Repo Avatar
40+
LabsCrypt/flowfi
41+
Telegram (ask questions / claim the issue here first): https://t.me/+DOylgFv1jyJlNzM0
42+
43+
Why this matters
44+
frontend/src/components/dashboard/StreamDetailsModal.tsx:30,94-95,106,138 renders {stream.withdrawn}/{stream.deposited}/{remaining} with no formatter, and remaining = stream.deposited - stream.withdrawn is plain JS float subtraction (artifacts like 99.99999999). CancelConfirmModal.tsx:39,106-110,118 has the identical raw-render. The stream-detail page uses formatAmount for the same values.
45+
46+
Acceptance criteria
47+
deposited/withdrawn/remaining are rendered through a shared amount formatter (consistent decimals)
48+
remaining is computed without producing floating-point display artifacts
49+
StreamDetailsModal and CancelConfirmModal match the formatting used on the stream-detail page
50+
Files to touch
51+
frontend/src/components/dashboard/StreamDetailsModal.tsx
52+
frontend/src/components/stream-creation/CancelConfirmModal.tsx
53+
Out of scope
54+
Changing the Stream data model
55+
56+
#865 [Frontend] Settings Display Preferences (Default Token / Amount Format / Decimal Places) are a no-op - never consumed anywhere
57+
Repo Avatar
58+
LabsCrypt/flowfi
59+
Telegram (ask questions / claim the issue here first): https://t.me/+DOylgFv1jyJlNzM0
60+
61+
Why this matters
62+
frontend/src/app/settings/page.tsx:244-307 lets users pick Default Token, Amount Format, and Decimal Places and persists them to localStorage, and useSettings exports formatAmountWithPreference/getDecimalPlaces/getAmountFormat/getDisplayCurrency. A repo-wide grep shows these helpers and useSettings have ZERO consumers - every amount uses hardcoded formatters. The settings controls produce no visible effect.
63+
64+
Acceptance criteria
65+
Amount rendering reads the user's decimalPlaces/amountFormat preference in the main amount displays, or
66+
If the preference feature is not ready, the non-functional controls are removed/marked clearly
67+
Changing Decimal Places visibly changes displayed amounts on at least the dashboard and stream detail views
68+
Files to touch
69+
frontend/src/app/settings/page.tsx
70+
frontend/src/hooks/useSettings.ts
71+
Out of scope
72+
Theme toggle (which does work)
73+
Currency conversion / price feeds

0 commit comments

Comments
 (0)