test(auth): fix AuthManager onboarding-resume tests for display-name gate - #1185
Merged
Merged
Conversation
…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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Fixes the two
AuthManagerTestfailures that landed oncode/cashafter the onboarding display-name change was merged.Failing on CI:
AuthManagerTest > login resumes at PostAccessKey when registered but onboarding not completedAuthManagerTest > login falls back to Onboarding when flags exhausted and onboarding not completedWhy
The onboarding change reordered
AuthManager.login()'s resume logic so a missing display name resumes atResumePoint.DisplayName(after the access key) before falling through toPostAccessKey. These tests mock a relaxedUserManagerwhoseprofileisnull, sodisplayNameMissingwastrueand both cases resolved toDisplayNameinstead of the assertedPostAccessKey.The onboarding PR updated its own modules' tests (login, app) but didn't touch
AuthManagerTestin theauthenticationmodule, so this failure surfaced only after merge.How
setUpto one that already has a display name, so the post-access-key resume paths behave as before.DisplayNameresume path (access key seen, registered, no display name set).Testing
:apps:flipcash:shared:authentication:testDebugUnitTest --tests AuthManagerTest— green (incl. the new case).login,app,services/flipcash,session,user-profile) — all green.