Skip to content
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

[DataGrid] Restore regression test #503

Merged
merged 1 commit into from
Oct 26, 2020

Conversation

oliviertassinari
Copy link
Member

@oliviertassinari oliviertassinari commented Oct 26, 2020

The test was skipped in #412.

@eps1lon In this case, we are only interested in testing that the error boundary reports the problem. It's the same as https://github.com/mui-org/material-ui/blob/db3581f75f88905e2791560c0527010f98a92a9b/packages/material-ui/src/Select/Select.test.js#L849.

Is there a way to ignore the console.error calls? I guess @dtassone has skipped the test because it wasn't obvious, at first sight, what was the solution. But anyway, it's probably an edge case, we can move forward like this :)

@oliviertassinari oliviertassinari added test component: data grid This is the name of the generic UI component, not the React module! labels Oct 26, 2020
Copy link
Member

@dtassone dtassone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! I knew you would be quick on this one ;)

@oliviertassinari oliviertassinari merged commit 180a893 into mui:master Oct 26, 2020
@oliviertassinari oliviertassinari deleted the test-error-test branch October 26, 2020 21:39
@eps1lon
Copy link
Member

eps1lon commented Oct 27, 2020

There's no safe API that doesn't lead to swallowing of error messages as far as I can tell. This is just how thrown errors work in React. I wouldn't recommend ignoring errors anyway. Tests should be optimized for descriptiveness and illustrate what a user would see. Ignoring the console.error calls would not tell you about the actual DX.

This is less of an issue in React 17 where the double logs from StrictMode are hidden by default.

dtassone pushed a commit to dtassone/material-ui-x that referenced this pull request Nov 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: data grid This is the name of the generic UI component, not the React module! test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants