test(auth): cover the write-through recoveries and the custom reauth slot's sheet chrome - #2476
Merged
russellwheatley merged 2 commits intoSep 4, 2026
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request adds comprehensive unit tests to FirebaseAuthScreenEmailRecoveryTest.kt and ReauthSurfaceGateTest.kt. The new tests in FirebaseAuthScreenEmailRecoveryTest.kt verify account recovery flows that pass data (such as credentials or links) to subsequent steps, including account linking, email-link prompts, and cross-device linking. The tests added to ReauthSurfaceGateTest.kt validate the behavior of custom-slot presentation gates, ensuring that the method picker is rendered bare while sub-flows are properly enclosed within the library's sheet. There are no review comments, and I have no feedback to provide.
demolaf
marked this pull request as ready for review
September 4, 2026 12:36
…the step they move to
…inside the library sheet
demolaf
force-pushed
the
feat/reauth-and-recovery-test-coverage
branch
from
September 4, 2026 12:54
06d3dd4 to
681dc8d
Compare
demolaf
marked this pull request as draft
September 4, 2026 12:54
demolaf
marked this pull request as ready for review
September 4, 2026 12:59
russellwheatley
approved these changes
Sep 4, 2026
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.
Three error recoveries hand the step they navigate to a value the failure carried, and none were covered:
AccountLinkingRequiredExceptionwritespendingLinkingCredential, andEmailLinkPromptForEmailException/EmailLinkCrossDeviceLinkingExceptionboth writeemailLinkFromDifferentDevice. Separately, a customreauthContentslot isBareonly onMethodPicker— email and phone sub-steps still wrap in the library sheet, and nothing asserted that chrome was present.FirebaseAuthScreenEmailRecoveryTest: 7 cases covering landing step and address for each of the three exceptions, plus the write-through itself — a reallinkWithCredentialverification for account linking, andisSignInWithEmailLinkfor both email-link failures.ReauthSurfaceGateTest: 3 cases — the method picker composes bare under a custom slot, and the email and phone steps are asserted to be inside the sheet via ancestry rather than as separate presence checks.Checked each case against a mutated production branch: dropping the credential write, nulling the prompt's link, swapping the cross-device branch to
providerName, and ignoring the step in the reauth gate each fail only their own test.Maintainer note: Fixes internal CPRN-404