Skip to content

fix(tests): settings golden renders software wallet path#585

Merged
TaprootFreak merged 4 commits into
chore/post-541-followupsfrom
fix/settings-golden-software-wallet
May 26, 2026
Merged

fix(tests): settings golden renders software wallet path#585
TaprootFreak merged 4 commits into
chore/post-541-followupsfrom
fix/settings-golden-software-wallet

Conversation

@TaprootFreak
Copy link
Copy Markdown
Contributor

Re-opens #582 from the main repo so the self-hosted dfx01 runner can execute. Original PR was from a fork (Blume1977/realunit-app), where workflow_dispatch cannot reach the runner.

Summary

  • settings_page.dart:100 only renders the Wallet-Sicherung tile when openWallet?.walletType == WalletType.software.
  • The existing golden test (settings_golden_test.dart) used const HomeState()openWallet defaulted to null, so the tile never appeared in settings_page_default.png.
  • Handbook entry #12-settings lists Wallet-Sicherung in its description but the PNG never showed it — visible mismatch.
  • Stub the HomeBloc state with a MockSoftwareWallet so the golden matches the actual production state of users navigating to Settings.

Why

The handbook documents the software-wallet user journey end-to-end (BitBox is only a branch on screen #2). Any conditionally-rendered tile gated by walletType == WalletType.software must appear in the handbook PNG.

Verified

  • Golden-regenerate workflow ran on dfx01 → bot committed regenerated settings_page_default.png (5806d9e) showing the Wallet-Sicherung tile.
  • Visual inspection: tile rendered between Wallet-Adresse and Geschäftsbeziehung beenden, matches the handbook description.
  • Empty re-trigger commit (d9b4a96) per the bot-push gotcha documented in docs/visual-regression-tests.md.

Commits

SHA Author Topic
c2d2276 Jana Rüttimann (Blume1977) fix(tests): use MockSoftwareWallet in setUp
199c3e9 Jana Rüttimann (Blume1977) docs(handbook): note Wallet-Sicherung visibility on #12-settings
5806d9e github-actions[bot] regenerated baselines on dfx01
d9b4a96 me empty commit to re-arm CI per bot-push gotcha

Out of scope

  • BitBox-Wallet-Variante des Settings-Goldens — die HTML-Erklärung erwähnt das BitBox-Verhalten, aber kein PNG pinnt es. Separater Follow-up (siehe Issue-Backlog).

@TaprootFreak TaprootFreak marked this pull request as ready for review May 26, 2026 14:18
Blume1977 added 2 commits May 26, 2026 16:19
The settings page conditionally renders the "Wallet-Sicherung" (backup)
tile only when an open SoftwareWallet is present (settings_page.dart:100).
The golden test was using const HomeState() — openWallet null — so the
tile never appeared in settings_page_default.png, leaving the handbook
entry #12-settings inconsistent with the documented description.

Stub the HomeBloc state with a MockSoftwareWallet so the rendered golden
matches what software-wallet users actually see in Settings.

PNG regeneration follows via golden-regenerate.yaml on dfx01.
Add a sentence to the #12-settings description explaining that the
Wallet-Sicherung tile is software-wallet-only: BitBox users don't see
it because the backup lives on the hardware device itself
(settings_page.dart:100 — gated by walletType == WalletType.software).

Pairs with the test-fixture fix in the same PR so the regenerated PNG
and the prose agree.
@TaprootFreak TaprootFreak force-pushed the fix/settings-golden-software-wallet branch from d9b4a96 to 3833e58 Compare May 26, 2026 14:19
github-actions Bot and others added 2 commits May 26, 2026 16:25
Per docs/visual-regression-tests.md "Regenerating baselines" gotcha:
GITHUB_TOKEN-driven pushes don't trigger `pull_request: synchronize`,
so the bot's baseline commit 44b64cb has zero status checks reported.
Empty user-signed commit re-arms the checks.
@TaprootFreak TaprootFreak merged commit d703692 into chore/post-541-followups May 26, 2026
6 checks passed
@TaprootFreak TaprootFreak deleted the fix/settings-golden-software-wallet branch May 26, 2026 14:38
TaprootFreak added a commit that referenced this pull request May 26, 2026
Re-opens [#584](#584)
(closed because its base \`chore/post-541-followups\` was deleted after
the collection-merge
[#571](#571)).
Cherry-picked Jana's original commit (\`517170a\`) onto the new
collection branch \`chore/post-580-followups\`.

## Summary

The "Support kontaktieren" tile under Settings → Kontakt must always be
visible — including pre-signin onboarding flows where the user has not
yet registered an email. Render it unconditionally and drop the
surrounding cubit/state machinery that only existed to gate this single
tile.

## Pair PR

Pairs with
[DFXswiss/api#3761](DFXswiss/api#3761) (drops
\`UserCapabilitiesDto.supportAvailable\`).

**Merge order is unconstrained — both PRs are independent-safe:**

| Order | Backend sends | App reads | Crash? |
|---|---|---|---|
| App-PR alone merged | \`supportAvailable: true/false\` still in JSON |
Field no longer read in \`fromJson\` — Dart \`Map<String,dynamic>\`
silently ignores unknown keys | No |
| API-PR alone merged | Field gone from JSON | Old app code reads
\`json['supportAvailable'] as bool? ?? false\` → \`false\` → tile stays
hidden (existing bug persists) | No |
| Both merged | Backend stops sending, app stops reading | — | No |

The DTO uses \`as bool? ?? false\` (nullable cast with default fallback)
for every capability flag, so neither side is brittle to the other's
deploy timing. Earlier "Merge order: API first" claim was inaccurate.

## Review history

Audited via subagent during the #584 cycle (clean, no MAJORs). Main-repo
mirror was needed for Visual Regression on the dfx01 self-hosted runner
(same Fork-PR pattern as
[#585](#585)).

Credit: code-diff by Jana Rüttimann (\`Blume1977\`).

---------

Co-authored-by: Blume1977 <jana.ruettimann@dfx.swiss>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.

2 participants