Skip to content

test(auth): fix AuthManager onboarding-resume tests for display-name gate - #1185

Merged
bmc08gt merged 1 commit into
code/cashfrom
fix/authmanager-displayname-resume-tests
Aug 5, 2026
Merged

test(auth): fix AuthManager onboarding-resume tests for display-name gate#1185
bmc08gt merged 1 commit into
code/cashfrom
fix/authmanager-displayname-resume-tests

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

What

Fixes the two AuthManagerTest failures that landed on code/cash after the onboarding display-name change was merged.

Failing on CI:

  • AuthManagerTest > login resumes at PostAccessKey when registered but onboarding not completed
  • AuthManagerTest > login falls back to Onboarding when flags exhausted and onboarding not completed

Why

The onboarding change reordered AuthManager.login()'s resume logic so a missing display name resumes at ResumePoint.DisplayName (after the access key) before falling through to PostAccessKey. These tests mock a relaxed UserManager whose profile is null, so displayNameMissing was true and both cases resolved to DisplayName instead of the asserted PostAccessKey.

The onboarding PR updated its own modules' tests (login, app) but didn't touch AuthManagerTest in the authentication module, so this failure surfaced only after merge.

How

  • Default the mocked profile in setUp to one that already has a display name, so the post-access-key resume paths behave as before.
  • Add a test for the new DisplayName resume path (access key seen, registered, no display name set).

Testing

  • :apps:flipcash:shared:authentication:testDebugUnitTest --tests AuthManagerTest — green (incl. the new case).
  • Also ran unit tests for the other onboarding-touched modules (login, app, services/flipcash, session, user-profile) — all green.

…gate

The onboarding display-name change reordered AuthManager.login()'s resume
logic: a missing display name now resumes at ResumePoint.DisplayName (after
the access key) before falling through to PostAccessKey. The existing
AuthManagerTest cases mocked a relaxed UserManager whose profile was null,
so displayNameMissing was true and the registered / flags-exhausted cases
resolved to DisplayName instead of the asserted PostAccessKey — failing on
code/cash after the merge.

- Default the mocked profile to one with a display name in setUp, so the
  post-access-key resume paths behave as before.
- Add coverage for the new DisplayName resume path (access key seen,
  registered, no display name set).
@github-actions github-actions Bot added type: test Test additions or improvements area: auth Login, session, access keys, identity labels Aug 5, 2026
@bmc08gt
bmc08gt merged commit 47ecceb into code/cash Aug 5, 2026
3 checks passed
@bmc08gt
bmc08gt deleted the fix/authmanager-displayname-resume-tests branch August 5, 2026 19:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: auth Login, session, access keys, identity type: test Test additions or improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant