-
Notifications
You must be signed in to change notification settings - Fork 843
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
[EuiErrorBoundary] Add default data-test-subj
#5232
[EuiErrorBoundary] Add default data-test-subj
#5232
Conversation
Preview documentation changes for this PR: https://eui.elastic.co/pr_5232/ |
Preview documentation changes for this PR: https://eui.elastic.co/pr_5232/ |
jenkins test this |
Preview documentation changes for this PR: https://eui.elastic.co/pr_5232/ |
Preview documentation changes for this PR: https://eui.elastic.co/pr_5232/ |
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.
LGTM! Some minor comments/q's, nothing blocking
describe('with an error thrown', () => { | ||
it('UI is rendered', () => { | ||
// Prevent the React boundary error from appearing in the terminal. | ||
spyOn(console, 'error'); |
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.
Ha this blows my mind, I've never actually used spyOn
without the jest.spyOn
prefix, but I guess it makes sense that it's a global 🤯
I am slightly confused by the comment though, AFAIK jest.spyOn
doesn't silence anything without using jest.spyOn(something).mockImplementation(() => {})
, so unless I'm wrong we're not actually using for the comment's purpose?
(feel free to merge w/o addressing this comment also as I know it's previous code + not a blocker)
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.
Welp, it turns out that the comment is entirely false. Removing spyOn(console, 'error');
does not result in error messages in the console. Will remove.
Thanks for the question!
Preview documentation changes for this PR: https://eui.elastic.co/pr_5232/ |
* data-test-subj; clean up * tests * CL * test clean up
Summary
Adds a default
data-test-subj
and still accepts any from consumers.Checklist
- [ ] Check against all themes for compatibility in both light and dark modes- [ ] Checked in mobile- [ ] Checked in Chrome, Safari, Edge, and Firefox- [ ] Props have proper autodocs and playground toggles- [ ] Added documentation- [ ] Checked Code Sandbox works for any docs examples- [ ] Checked for accessibility including keyboard-only and screenreader modes