Skip to content

test(utils): svg_parser + device_info + default_assets (+14 tests)#345

Merged
TaprootFreak merged 2 commits into
developfrom
test/small-utils
May 15, 2026
Merged

test(utils): svg_parser + device_info + default_assets (+14 tests)#345
TaprootFreak merged 2 commits into
developfrom
test/small-utils

Conversation

@TaprootFreak
Copy link
Copy Markdown
Contributor

Summary

Stage 22 of the coverage push. Pure-Dart utility files.

File Cases
`lib/packages/utils/svg_parser.dart` 5
`lib/packages/utils/device_info.dart` 5
`lib/packages/utils/default_assets.dart` 4

What each file covers

  • svg_parser: integer + decimal mm → px conversion at 96 DPI (≈ 3.7795 px/mm), non-mm units pass through unchanged, every `mm` occurrence is replaced (multiple per string), surrounding SVG markup is preserved.
  • device_info: iOS / Android / macOS / Windows+Linux / Fuchsia matrix using `debugDefaultTargetPlatformOverride` (save + restore around each test so a failure doesn't leak the override).
  • default_assets: mainnet `realUnitAsset` and Sepolia `realUnitTestAsset` pinned to their production / dev contract addresses + decimals + symbols (a typo here would silently route the entire fiat pipeline at the wrong contract). ETH and ZCHF asset-id constants also pinned.

Test plan

  • `flutter analyze` clean
  • `flutter test` — 14 / 14 passing locally
  • CI green

Stage 22 of the coverage push. Pure-Dart utility files.

- svg_parser (5): integer + decimal mm → px conversion at 96 DPI,
  non-mm units passthrough, replaces every mm occurrence, preserves
  surrounding SVG markup
- device_info (5): iOS / Android / macOS / Windows+Linux / Fuchsia
  platform-flag matrix (with debugDefaultTargetPlatformOverride save
  + restore around each test)
- default_assets (4): mainnet + Sepolia contract / chainId / decimals
  pinned to the production values; ETH and ZCHF asset-id constants
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:43
@TaprootFreak TaprootFreak merged commit b300495 into develop May 15, 2026
1 check passed
@TaprootFreak TaprootFreak deleted the test/small-utils branch May 15, 2026 12:43
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