tests(clerk_flutter): improving ClerkSignInPanel and ClerkSignUpPanel tests - #429
Open
MarkOSullivan94 wants to merge 1 commit into
Conversation
MarkOSullivan94
marked this pull request as ready for review
July 6, 2026 17:34
slightfoot
force-pushed
the
main
branch
3 times, most recently
from
July 16, 2026 21:23
71a3098 to
5dcfe4b
Compare
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.
Resolves #428
Why
The
ClerkSignInPanelandClerkSignUpPaneltests undertest/integration/were a solid starting point for exercising the sign-in and sign-up flows, but they run withflutter_testagainst mocked services rather than on a device, so they are widget tests by Flutter's definition — and with Patrol now covering true end-to-end flows (#410, #412), the folder name no longer reflected what they do.While moving them, I noticed the tests could only verify that
ClerkSignInPanelandClerkSignUpPanelthemselves were present in the tree: both panels build an empty widget when noEnvironmentis available, and the test mocks only supplied aClient, so no form fields or buttons were rendered beneath them. Supplying a mocked environment lets the tests assert on the actual UI for each scenario.What
Test support
createTestEnvironment(), building anEnvironmentfrom required/optional user attributes (with matching verification strategies) and identification strategies. The two panels have different rendering gates:ClerkSignUpPanelis driven byenv.user.attributes, whileClerkSignInPanelrequires a non-emptyenv.config.identificationStrategies.createTestAuthState()now accepts anenvironment, served byTestHttpServicefrom the mocked/environmentendpoint.Test files
test/integration/*→test/widgets/clerk_sign_in_panel_test.dartandtest/widgets/clerk_sign_up_panel_test.dart, one file per widget under test.ClerkSignInPaneltests into one test each for: password, email code, password + email code, phone code, and second factor (TOTP + backup code).renders X when Y).Test plan
flutter testinpackages/clerk_flutter: 779 passed, 7 skipped (count down from 781 due to consolidating duplicate scenarios).