Skip to content

test: NetworkMode + ApiConfig + mnemonic_field extension (+11 tests)#346

Merged
TaprootFreak merged 2 commits into
developfrom
test/repositories-and-401
May 15, 2026
Merged

test: NetworkMode + ApiConfig + mnemonic_field extension (+11 tests)#346
TaprootFreak merged 2 commits into
developfrom
test/repositories-and-401

Conversation

@TaprootFreak
Copy link
Copy Markdown
Contributor

Summary

Stage 23 of the coverage push. Three small pure-Dart targets that round out the config + widget-extension surface.

File Cases (new)
`lib/packages/config/network_mode.dart` 3 (new file)
`lib/packages/config/api_config.dart` 6 (appended to existing)
`lib/widgets/mnemonic_field.dart` (`SeedStringExtension`) 5 (new file)

What each file covers

  • network_mode: mainnet / testnet getters + name; `NetworkMode.values` has exactly 2 entries (a third would silently bypass every `switch (mode)` call site).
  • api_config (extension): testnet `asset` = `realUnitTestAsset`, testnet ids = Sepolia; mainnet `asset` = `realUnitAsset`, mainnet ids = Ethereum; `buildUri` produces https URIs; appends queryParams when provided; omits the query string when null.
  • mnemonic_field SeedStringExtension: splits a 12-word mnemonic correctly; collapses tabs and multi-space runs; empty / whitespace-only input → `[]`; trims leading/trailing whitespace; preserves word order.

Test plan

  • `flutter analyze` clean
  • `flutter test` — 17 / 17 passing locally (incl. the 2 pre-existing api_config cases)
  • CI green

…11 tests)

Stage 23 of the coverage push.

- network_mode (3): mainnet getters + name; testnet getters + name;
  enum has exactly 2 values (catches accidental additions that
  would silently bypass switch-on-mode call sites)
- api_config (6 new alongside 2 existing): testnet asset =
  realUnitTestAsset; testnet ETH/ZCHF ids = Sepolia ids; mainnet
  asset = realUnitAsset; mainnet ETH/ZCHF ids = Ethereum ids;
  buildUri produces https URIs; appends/omits queryParams correctly
- mnemonic_field SeedStringExtension (5): splits 12-word mnemonic;
  collapses tabs / multi-space; empty + whitespace-only → []; trims;
  preserves word order
PR #321 removed DfxWidgetService from HomeBloc but didn't update the
test, leaving develop's home_bloc_test.dart broken — CI on every
subsequent PR fails the compile step.

This bundles the fix into the stage 23 PR so unblocking can happen in
one merge instead of a separate fix PR.
@TaprootFreak TaprootFreak marked this pull request as ready for review May 15, 2026 12:29
@TaprootFreak TaprootFreak merged commit 8d301a0 into develop May 15, 2026
1 check passed
@TaprootFreak TaprootFreak deleted the test/repositories-and-401 branch May 15, 2026 12:29
TaprootFreak added a commit to joshuakrueger-dfx/realunit-app that referenced this pull request May 15, 2026
… merge

Two professional cleanup items found while reviewing the PR end-to-end:

- `toBitboxSafeAsciiOrNull` was defined and tested but never called from
  production code — `git grep` shows 0 callsites outside its own spec.
  Removed the 2-line wrapper and its dedicated test group. If a nullable
  variant is ever needed, callers can use `?.let(toBitboxSafeAscii)` or
  the helper can be re-added when there is an actual consumer.

- `test/screens/home/home_bloc_test.dart` survived the merge with
  `origin/develop` (commit ba1a968) carrying its pre-RealUnitCH#346 shape: it
  still referenced the removed `DfxWidgetService` and passed 7 positional
  args to a 6-arg `HomeBloc(...)`. CI did not flag it on this branch but
  any local `flutter analyze` reports 4 errors. Aligned the file with
  the develop tip so the type-mismatch is gone.
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