Skip to content

test(amount-entry): cover hint freeze while sending - #1642

Merged
bmc08gt merged 1 commit into
code/cashfrom
test/amount-entry-hint-freeze
Sep 30, 2026
Merged

bmc08gt merged 1 commit into
code/cashfrom
test/amount-entry-hint-freeze

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Sep 30, 2026

Copy link
Copy Markdown
Collaborator

AmountEntryDelegate.config keeps the last idle config while the host is loading or has succeeded (the scan added in 132896a). Chat send, Give cash, Swap and Withdraw all rely on it to stop the "$X available" hint from jumping to the post-send balance and turning red before the sheet dismisses. That's the bug iOS shows today. The existing tests in AmountEntryDelegateTest and AmountEntryConfigTest only check that loadingState reaches the action, so removing the freeze would not fail anything.

The new test in AmountEntryDelegateTest walks one send:

  1. Max 100.77, entered 99: hint is Info.
  2. loading = true, max drops to 1.78: hint is unchanged, action shows loading.
  3. success = true, max still 1.78: hint is unchanged, action shows success.
  4. Back to idle: hint becomes the over-max Error.

AmountEntryDelegate.config keeps the last idle config while the host is
loading or has succeeded, so the "$X available" hint doesn't jump to the
post-send balance and turn red before the sheet dismisses. The existing
tests only checked that loadingState passes through to the action;
nothing asserted the freeze.

The new test enters 99 against a max of 100.77, drops the max to 1.78
during loading, and checks the Info hint holds through loading and
success, then turns into the over-max Error once loadingState is idle.
@bmc08gt bmc08gt self-assigned this Sep 30, 2026
@github-actions github-actions Bot added the type: test Test additions or improvements label Sep 30, 2026
@bmc08gt
bmc08gt merged commit ce2fc78 into code/cash Sep 30, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: test Test additions or improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant