Skip to content

test(widgets): mnemonic extensions + controller styling (+9 tests)#368

Merged
TaprootFreak merged 1 commit into
developfrom
test/mnemonic-seed-extensions
May 15, 2026
Merged

test(widgets): mnemonic extensions + controller styling (+9 tests)#368
TaprootFreak merged 1 commit into
developfrom
test/mnemonic-seed-extensions

Conversation

@TaprootFreak
Copy link
Copy Markdown
Contributor

Summary

Stage 44 of the coverage push. Pure-function tests for the seed-word string utilities and the BIP39 highlighting on the mnemonic input controller.

Cases

Target Cases
`SeedStringExtension.seedWords` 5 — splits on single spaces; collapses repeated whitespace + tabs; strips leading/trailing whitespace; treats newlines as whitespace; empty input returns empty list
`MnemonicListExtension.seed` 2 — joins controller texts and trims each entry; preserves the controller order
`MnemonicInputFieldController.buildTextSpan` 2 — base style for a word in the BIP39 list; merges in the red non-match style for an unknown word

What's pinned

  • The seed-word split uses `RegExp(r'\s+')`, so any whitespace boundary (tab / newline / multiple spaces) counts — all four whitespace classes are exercised.
  • `MnemonicListExtension.seed` trims each controller entry individually before joining, so accidental leading/trailing spaces (e.g. from a paste) don't bleed into the recovered phrase.
  • `buildTextSpan` differentiates valid vs invalid BIP39 words via a style merge — a word that is in the wordlist returns the unmodified base style, anything else picks up the red status color. Pinned by both branches.

Test plan

  • `flutter test test/widgets/mnemonic_extensions_test.dart` — 9 pass
  • `flutter analyze` clean on the new file
  • CI green

Stage 44 of the coverage push. Pure-function tests for the
seed-word string utilities and the BIP39 highlighting on the
mnemonic input controller.

- SeedStringExtension.seedWords (5): splits on single spaces;
  collapses repeated whitespace + tabs; strips leading/trailing
  whitespace; treats newlines as whitespace; empty input returns
  empty list
- MnemonicListExtension.seed (2): joins controller texts and
  trims each; preserves the controller order
- MnemonicInputFieldController.buildTextSpan (2): returns the
  base style for a word in the BIP39 list; merges in the red
  non-match style for an unknown word
@TaprootFreak TaprootFreak marked this pull request as ready for review May 15, 2026 19:09
@TaprootFreak TaprootFreak merged commit 68c7d81 into develop May 15, 2026
1 check passed
@TaprootFreak TaprootFreak deleted the test/mnemonic-seed-extensions branch May 15, 2026 19:09
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