-
Notifications
You must be signed in to change notification settings - Fork 667
Add browser tests for polymorphic as prop behavior in styled-react components
#6911
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
Merged
liuliu-dev
merged 12 commits into
chore/fix-forward-as-prop
from
liuliu/add-browser-tests-for-polymophic-components
Sep 29, 2025
Merged
Changes from 9 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
5ec7476
check props when using as
liuliu-dev 77fe7ec
fixes
liuliu-dev 8c46006
format
liuliu-dev dcce319
Merge remote-tracking branch 'origin/chore/fix-forward-as-prop' into …
liuliu-dev 7c8232e
remove console log
liuliu-dev 3dff506
lint fix
liuliu-dev 415943a
check icon attribute
liuliu-dev ea7d99e
depreacted and experimental tests
liuliu-dev 7de5157
conflict
liuliu-dev 23d7042
Merge branch 'chore/fix-forward-as-prop' into liuliu/add-browser-test…
francinelucca 4e63f50
use div instead of default ul
liuliu-dev eae2c6c
Merge branch 'chore/fix-forward-as-prop' into liuliu/add-browser-test…
liuliu-dev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Oops, something went wrong.
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.
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.
This caught my eye, why do we need to explicitly set ActionList as="ul"?
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.
Hi @siddharthkp, thanks for the review! Do you mean that we should use
as="div"instead of the defaultulforActionList?Uh oh!
There was an error while loading. Please reload this page.
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.
No sorry, I meant why do we need to pass it any
asprop? Does it no longer render a<ul>by default?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
asprop in this test is specifically to catch thepolymorphicprop forwarding issue that the pattern in PR #6910 fixes, when you wrap a component withstyled(), theasprop can get consumed bystyled-componentsinstead of being forwarded to the wrapped component, which causes component specific props to fail to be consumed correctly. That's why we add bothasandvarianthere to test thatvariantis correctly passed.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.
Oh lol, my bad! That is literally what you are testing 😅
This is a very good idea in that case!