Skip to content

Commit 1bf0188

Browse files
committed
[test] Update react next patch
1 parent d345282 commit 1bf0188

File tree

1 file changed

+34
-15
lines changed

1 file changed

+34
-15
lines changed

scripts/react-next.diff

Lines changed: 34 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
diff --git a/packages/material-ui-lab/src/Autocomplete/Autocomplete.test.js b/packages/material-ui-lab/src/Autocomplete/Autocomplete.test.js
2-
index 1fd4bad8b..20d22063b 100644
2+
index af7e296af..144de6de4 100644
33
--- a/packages/material-ui-lab/src/Autocomplete/Autocomplete.test.js
44
+++ b/packages/material-ui-lab/src/Autocomplete/Autocomplete.test.js
5-
@@ -1038,8 +1038,6 @@ describe('<Autocomplete />', () => {
5+
@@ -1109,8 +1109,6 @@ describe('<Autocomplete />', () => {
66
fireEvent.change(textbox, { target: { value: 'a' } });
77
fireEvent.keyDown(textbox, { key: 'Enter' });
88
}).toErrorDev([
@@ -11,7 +11,7 @@ index 1fd4bad8b..20d22063b 100644
1111
'Material-UI: The `getOptionLabel` method of Autocomplete returned undefined instead of a string',
1212
'Material-UI: The `getOptionLabel` method of Autocomplete returned undefined instead of a string',
1313
'Material-UI: The `getOptionLabel` method of Autocomplete returned undefined instead of a string',
14-
@@ -1094,9 +1092,6 @@ describe('<Autocomplete />', () => {
14+
@@ -1165,9 +1163,6 @@ describe('<Autocomplete />', () => {
1515
/>,
1616
);
1717
}).toWarnDev([
@@ -21,7 +21,7 @@ index 1fd4bad8b..20d22063b 100644
2121
'None of the options match with `"not a good value"`',
2222
'None of the options match with `"not a good value"`',
2323
]);
24-
@@ -1122,11 +1117,7 @@ describe('<Autocomplete />', () => {
24+
@@ -1193,11 +1188,7 @@ describe('<Autocomplete />', () => {
2525
groupBy={(option) => option.group}
2626
/>,
2727
);
@@ -35,7 +35,7 @@ index 1fd4bad8b..20d22063b 100644
3535
expect(options).to.have.length(7);
3636
expect(options).to.deep.equal(['A', 'D', 'E', 'B', 'G', 'F', 'C']);
3737
diff --git a/packages/material-ui-lab/src/TreeView/TreeView.test.js b/packages/material-ui-lab/src/TreeView/TreeView.test.js
38-
index 056a9fcbc..21eeee2cf 100644
38+
index 7169af632..481b8106c 100644
3939
--- a/packages/material-ui-lab/src/TreeView/TreeView.test.js
4040
+++ b/packages/material-ui-lab/src/TreeView/TreeView.test.js
4141
@@ -8,6 +8,7 @@ import { getClasses } from '@material-ui/core/test-utils';
@@ -46,16 +46,6 @@ index 056a9fcbc..21eeee2cf 100644
4646

4747
describe('<TreeView />', () => {
4848
let classes;
49-
@@ -58,7 +59,8 @@ describe('<TreeView />', () => {
50-
51-
// should not throw eventually or with a better error message
52-
// FIXME: https://github.com/mui-org/material-ui/issues/20832
53-
- it('crashes when unmounting with duplicate ids', () => {
54-
+ // FIXME: unclear what is happening in react@next
55-
+ it.skip('crashes when unmounting with duplicate ids', () => {
56-
const CustomTreeItem = () => {
57-
return <TreeItem nodeId="iojerogj" />;
58-
};
5949
diff --git a/packages/material-ui-styles/src/ThemeProvider/ThemeProvider.test.js b/packages/material-ui-styles/src/ThemeProvider/ThemeProvider.test.js
6050
index 46238825d..bcf275893 100644
6151
--- a/packages/material-ui-styles/src/ThemeProvider/ThemeProvider.test.js
@@ -156,6 +146,35 @@ index ef6533f4b..bd5633dc4 100644
156146
});
157147
});
158148
});
149+
diff --git a/packages/material-ui/src/Unstable_TrapFocus/Unstable_TrapFocus.js b/packages/material-ui/src/Unstable_TrapFocus/Unstable_TrapFocus.js
150+
index 97fac726d..e43c9f5d4 100644
151+
--- a/packages/material-ui/src/Unstable_TrapFocus/Unstable_TrapFocus.js
152+
+++ b/packages/material-ui/src/Unstable_TrapFocus/Unstable_TrapFocus.js
153+
@@ -159,11 +159,19 @@ function Unstable_TrapFocus(props) {
154+
155+
// restoreLastFocus()
156+
if (!disableRestoreFocus) {
157+
- // In IE 11 it is possible for document.activeElement to be null resulting
158+
- // in nodeToRestore.current being null.
159+
- // Not all elements in IE 11 have a focus method.
160+
- // Once IE 11 support is dropped the focus() call can be unconditional.
161+
- if (nodeToRestore.current && nodeToRestore.current.focus) {
162+
+ if (
163+
+ // In IE 11 it is possible for document.activeElement to be null resulting
164+
+ // in nodeToRestore.current being null.
165+
+ nodeToRestore.current &&
166+
+ // Not all elements in IE 11 have a focus method.
167+
+ // Once IE 11 support is dropped the focus() call can be unconditional.
168+
+ nodeToRestore.current.focus &&
169+
+ // We actually only want a WeakRef to nodeToRestore.
170+
+ // If it's already unmounted don't restore focus to it.
171+
+ // Can't reproduce it on an isolated test but "should trap once the focus moves inside" failed due to interleaving restore logic from the previous test.
172+
+ // TODO: Is this a JSDOM issue?
173+
+ nodeToRestore.current.isConnected
174+
+ ) {
175+
nodeToRestore.current.focus();
176+
}
177+
159178
diff --git a/packages/material-ui/src/internal/SwitchBase.test.js b/packages/material-ui/src/internal/SwitchBase.test.js
160179
index 27b143abf..7c321b14a 100644
161180
--- a/packages/material-ui/src/internal/SwitchBase.test.js

0 commit comments

Comments
 (0)