-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
fix: remove hardcoded default testIDs from components #5088
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -141,7 +141,7 @@ const Card = ({ | |
| style, | ||
| contentStyle, | ||
| theme: themeOverrides, | ||
| testID = 'card', | ||
| testID, | ||
| accessible, | ||
| disabled, | ||
| ref, | ||
|
|
@@ -225,13 +225,13 @@ const Card = ({ | |
| style={[{ borderColor }, style]} | ||
| theme={theme} | ||
| elevation={elevation} | ||
| testID={`${testID}-container`} | ||
| testID={testID ? `${testID}-container` : undefined} | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Five other components build child testIDs without this guard, so they render a literal
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missed them, included in the new commit. |
||
| {...rest} | ||
| > | ||
| {isMode('outlined') && ( | ||
| <View | ||
| pointerEvents="none" | ||
| testID={`${testID}-outline`} | ||
| testID={testID ? `${testID}-outline` : undefined} | ||
| style={[ | ||
| { | ||
| borderColor, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The removed defaults need a bullet in the migration guide's "Test IDs" section (
docs/6.x/docs/guides/migration.md) —- it already lists the onesSurfaceandAppbar.Headerlost. Otherwise anyone selectingbutton,cardorsearch-barin their e2e tests loses those matches silently.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. Added information to migration guide.