-
Notifications
You must be signed in to change notification settings - Fork 525
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
Fix duplicate user props #2256
Merged
Merged
Fix duplicate user props #2256
Conversation
This file contains 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
becca-bailey
commented
May 25, 2022
packages/victory-core/src/victory-clip-container/victory-clip-container.js
Show resolved
Hide resolved
becca-bailey
commented
May 25, 2022
Other than maybe deleting that unneeded test util, this looks good to me! |
scottrippey
reviewed
May 25, 2022
scottrippey
reviewed
May 25, 2022
scottrippey
reviewed
May 25, 2022
scottrippey
approved these changes
May 25, 2022
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.
Great changes, glad to see an easy way to add these userProps.
Minor changes requested for using jest-dom
, otherwise good!
heythisispaul
approved these changes
May 25, 2022
This moves the user props logic from the container component to the top-level returned component, whether that is a container or a group component. This allows the safe props to work in a standlone component, or a component that is a child of another victory container or VictoryChart component.
becca-bailey
force-pushed
the
bug/fix-duplicate-user-props
branch
from
May 25, 2022 19:47
fa40657
to
460ac09
Compare
@heythisispaul you should be able to merge this into your PR now. |
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.
This fixes a bug that Paul and I were running into where the user props like
data-testid
andaria-label
were being passed in to both the container and the group component, so even when we were rendering a victory data component as a standalone component (without a container or VictoryChart wrapper),screen.getByTestId
was returning multiple nodes in the tests rather than the parent wrapper component.In order to fix this, I removed the user props logic from the
renderData
function inadd-events
, and passed the user props into the root component that was returned from a Victory component rather than the container. This ensures that the props will be passed into either thesvg
or theg
component, depending on whether there is another container present. I also added some additional test coverage around this, which we should add to other component tests as we convert them.