-
Notifications
You must be signed in to change notification settings - Fork 357
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
chore(ClipboardCopy): updated tests #9574
chore(ClipboardCopy): updated tests #9574
Conversation
Preview: https://patternfly-react-pr-9574.surge.sh A11y report: https://patternfly-react-pr-9574-a11y.surge.sh |
ea1243e
to
3c7d4f4
Compare
4c71132
to
a71fe93
Compare
476fa44
to
e96b4bf
Compare
I also updated how the |
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.
Awesome work on this so far, small handful of requsts/questions:
packages/react-core/src/components/ClipboardCopy/__tests__/ClipboardCopy.test.tsx
Show resolved
Hide resolved
packages/react-core/src/components/ClipboardCopy/__tests__/ClipboardCopy.test.tsx
Outdated
Show resolved
Hide resolved
packages/react-core/src/components/ClipboardCopy/__tests__/ClipboardCopy.test.tsx
Outdated
Show resolved
Hide resolved
packages/react-core/src/components/ClipboardCopy/__tests__/ClipboardCopy.test.tsx
Show resolved
Hide resolved
packages/react-core/src/components/ClipboardCopy/__tests__/ClipboardCopyButton.test.tsx
Outdated
Show resolved
Hide resolved
packages/react-core/src/components/ClipboardCopy/__tests__/ClipboardCopyButton.test.tsx
Outdated
Show resolved
Hide resolved
packages/react-core/src/components/ClipboardCopy/__tests__/ClipboardCopyButton.test.tsx
Show resolved
Hide resolved
const toggleButton = screen.getByRole('button'); | ||
expect(toggleButton).toHaveAttribute('aria-expanded', 'false'); | ||
}); | ||
expect(screen.getByRole('button')).toHaveAttribute('data-prop', 'test'); | ||
}); |
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.
Can you add tests for the default class and the className
prop?
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.
@tlabaj we had a question when discussing this. Currently the ClipboardCopyToggle component has className
as part of the interface, but it's spread in the props object which is placed on our Button component internally. Do you happen to know if that was the intent (passing a className to ClipboardCopyToggle renders the class on pf-v5-c-button
), or was the className meant to be passed on the div.pf-v5-c-clipboard-copy__toggle-icon"
?
ClipboardCopyToggle file for reference
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.
Can open up a new breaking change issue to spread the className div.pf-v5-c-clipboard-copy__toggle-icon
. We may also consider adding a new prop to add a classname to the button.
e96b4bf
to
68d6f8f
Compare
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.
🥳 looks great other than that last question about className
Your changes have been released in:
Thanks for your contribution! 🎉 |
* chore(ClipboardCopy): updated tests * Added tests for ClipboardCopy * Removed generated tests, added snapshot * Updated onTooltipHidden test to integration * Separated tooltip and callback tests * Adjusted wait time in cypress * Updated snapshots after rebase * Added tests for non-exported components * Updated per Austin comments
What: Closes #9532
Additional issues: