Skip to content

fix(kyc): MergeProcessing follow-ups — golden test, coverage, refresh-timeout guard#655

Open
joshuakrueger-dfx wants to merge 2 commits into
stagingfrom
feat/kyc-merge-processing-followups
Open

fix(kyc): MergeProcessing follow-ups — golden test, coverage, refresh-timeout guard#655
joshuakrueger-dfx wants to merge 2 commits into
stagingfrom
feat/kyc-merge-processing-followups

Conversation

@joshuakrueger-dfx
Copy link
Copy Markdown
Collaborator

Closes #654

Changes

Item 1+3 — Golden test for KycMergeProcessingPage

  • New test/goldens/screens/kyc/kyc_merge_processing_golden_test.dart, modeled on kyc_account_merge_golden_test.dart; uses pumpBeforeTest: pumpOnce because the page shows a CupertinoActivityIndicator (endless animation never settles).
  • macOS baseline generated on dfx01 via golden-regenerate.yaml (commit on this branch).
  • Coverage Floor Gate: page widgets are outside the lcov scope; the new cubit lines below are covered by the new unit test.

Item 4 — Refresh-timeout guard

  • KycCubit.checkKyc() captures the pre-run state (before _runCheckKyc replaces it with KycLoading). If the 30s watchdog fires on a refresh that started from KycMergeProcessing, the cubit re-emits KycMergeProcessing instead of KycFailure — the user stays on the waiting screen instead of being routed to the error screen.
  • New fakeAsync unit test (refresh from MergeProcessing + 31s elapse → stays on the waiting state); the existing watchdog test (non-merge state → KycFailure) is untouched and still proves the guard is narrowly scoped.
  • Genuine API errors during a refresh still surface as KycFailure (intentional).

Item 2 — Handbook mapping: intentionally omitted

  • Matches the established pattern: kyc_account_merge, kyc_loading, kyc_pending, kyc_failure and the other transient KYC states are deliberately not in the handbook; this avoids bumping the hard-coded screenshot count in the Handbook Build Check for a short-lived spinner state.

Verification

  • flutter test test/screens/kyc/cubits/kyc/kyc_cubit_test.dart — 36/36 green (incl. new test)
  • Golden renders locally (smoke); authoritative baseline from dfx01

joshuakrueger-dfx and others added 2 commits June 3, 2026 16:49
…golden test

- checkKyc() captures the pre-run state: a watchdog timeout during a refresh
  from KycMergeProcessing re-emits KycMergeProcessing instead of KycFailure,
  so a slow merge no longer routes the user to the error screen (#654 item 4)
- new fakeAsync unit test covers the guard (keeps the cubit coverage floor)
- new golden test for KycMergeProcessingPage with pumpOnce (endless spinner
  never settles); macOS baseline to be generated on dfx01 (#654 items 1+3)
- handbook mapping intentionally omitted, matching kyc_account_merge and the
  other transient KYC states (#654 item 2)
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