Skip to content

Commit 8d0d937

Browse files
authored
[test] Update react next patch (#21746)
1 parent 44f00aa commit 8d0d937

File tree

1 file changed

+44
-41
lines changed

1 file changed

+44
-41
lines changed

scripts/react-next.diff

Lines changed: 44 additions & 41 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
);
@@ -34,28 +34,6 @@ index 1fd4bad8b..20d22063b 100644
3434
const options = screen.getAllByRole('option').map((el) => el.textContent);
3535
expect(options).to.have.length(7);
3636
expect(options).to.deep.equal(['A', 'D', 'E', 'B', 'G', 'F', 'C']);
37-
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
39-
--- a/packages/material-ui-lab/src/TreeView/TreeView.test.js
40-
+++ b/packages/material-ui-lab/src/TreeView/TreeView.test.js
41-
@@ -8,6 +8,7 @@ import { getClasses } from '@material-ui/core/test-utils';
42-
import createMount from 'test/utils/createMount';
43-
import TreeView from './TreeView';
44-
import TreeItem from '../TreeItem';
45-
+import { act } from 'react-test-renderer';
46-
47-
describe('<TreeView />', () => {
48-
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-
};
5937
diff --git a/packages/material-ui-styles/src/ThemeProvider/ThemeProvider.test.js b/packages/material-ui-styles/src/ThemeProvider/ThemeProvider.test.js
6038
index 46238825d..bcf275893 100644
6139
--- a/packages/material-ui-styles/src/ThemeProvider/ThemeProvider.test.js
@@ -99,19 +77,6 @@ index cce608f6b..19cab2d18 100644
9977
});
10078

10179
it('should work when depending on a theme', () => {
102-
diff --git a/packages/material-ui-styles/src/withStyles/withStyles.test.js b/packages/material-ui-styles/src/withStyles/withStyles.test.js
103-
index d2a231d03..f247918fa 100644
104-
--- a/packages/material-ui-styles/src/withStyles/withStyles.test.js
105-
+++ b/packages/material-ui-styles/src/withStyles/withStyles.test.js
106-
@@ -110,7 +110,7 @@ describe('withStyles', () => {
107-
expect(sheetsRegistry.registry[0].classes).to.deep.equal({ root: 'Empty-root-2' });
108-
109-
wrapper.unmount();
110-
- expect(sheetsRegistry.registry.length).to.equal(0);
111-
+ expect(sheetsRegistry.registry.length).to.equal(1);
112-
});
113-
114-
it('should supply correct props to jss callbacks', () => {
11580
diff --git a/packages/material-ui/src/Breadcrumbs/Breadcrumbs.test.js b/packages/material-ui/src/Breadcrumbs/Breadcrumbs.test.js
11681
index f5c603b45..2f18cca5c 100644
11782
--- a/packages/material-ui/src/Breadcrumbs/Breadcrumbs.test.js
@@ -125,7 +90,7 @@ index f5c603b45..2f18cca5c 100644
12590
expect(screen.getAllByRole('listitem', { hidden: false })).to.have.length(4);
12691
expect(screen.getByRole('list')).to.have.text('first/second/third/fourth');
12792
diff --git a/packages/material-ui/src/Tabs/Tabs.test.js b/packages/material-ui/src/Tabs/Tabs.test.js
128-
index d5cd9ab15..d9affd078 100644
93+
index 733b29a97..37b52ab4d 100644
12994
--- a/packages/material-ui/src/Tabs/Tabs.test.js
13095
+++ b/packages/material-ui/src/Tabs/Tabs.test.js
13196
@@ -85,9 +85,6 @@ describe('<Tabs />', () => {
@@ -139,7 +104,7 @@ index d5cd9ab15..d9affd078 100644
139104
'Material-UI: You can not use the `centered={true}` and `variant="scrollable"`',
140105
]);
141106
diff --git a/packages/material-ui/src/TextareaAutosize/TextareaAutosize.test.js b/packages/material-ui/src/TextareaAutosize/TextareaAutosize.test.js
142-
index ef6533f4b..bd5633dc4 100644
107+
index e22016776..03db8933d 100644
143108
--- a/packages/material-ui/src/TextareaAutosize/TextareaAutosize.test.js
144109
+++ b/packages/material-ui/src/TextareaAutosize/TextareaAutosize.test.js
145110
@@ -253,12 +253,7 @@ describe('<TextareaAutosize />', () => {
@@ -156,6 +121,25 @@ index ef6533f4b..bd5633dc4 100644
156121
});
157122
});
158123
});
124+
diff --git a/packages/material-ui/src/Unstable_TrapFocus/Unstable_TrapFocus.js b/packages/material-ui/src/Unstable_TrapFocus/Unstable_TrapFocus.js
125+
index 97fac726d..bd6b758db 100644
126+
--- a/packages/material-ui/src/Unstable_TrapFocus/Unstable_TrapFocus.js
127+
+++ b/packages/material-ui/src/Unstable_TrapFocus/Unstable_TrapFocus.js
128+
@@ -163,7 +163,13 @@ function Unstable_TrapFocus(props) {
129+
// in nodeToRestore.current being null.
130+
// Not all elements in IE 11 have a focus method.
131+
// Once IE 11 support is dropped the focus() call can be unconditional.
132+
- if (nodeToRestore.current && nodeToRestore.current.focus) {
133+
+ if (
134+
+ nodeToRestore.current &&
135+
+ nodeToRestore.current.focus &&
136+
+ // TODO: Can be removed after https://github.com/jsdom/jsdom/pull/3005 is released.
137+
+ // We technically only want a WeakRef to nodeToRestore anyway.
138+
+ nodeToRestore.current.isConnected
139+
+ ) {
140+
nodeToRestore.current.focus();
141+
}
142+
159143
diff --git a/packages/material-ui/src/internal/SwitchBase.test.js b/packages/material-ui/src/internal/SwitchBase.test.js
160144
index 27b143abf..7c321b14a 100644
161145
--- a/packages/material-ui/src/internal/SwitchBase.test.js
@@ -195,3 +179,22 @@ index e5733f826..61333a172 100644
195179
});
196180
});
197181
});
182+
diff --git a/test/utils/createClientRender.js b/test/utils/createClientRender.js
183+
index 2b6184ff9..cc38b14ab 100644
184+
--- a/test/utils/createClientRender.js
185+
+++ b/test/utils/createClientRender.js
186+
@@ -87,6 +87,14 @@ function clientRender(element, options = {}) {
187+
return result;
188+
};
189+
190+
+ // TODO: Remove once we switch to `@testing-library/[email protected]`
191+
+ const testingLibraryUnmount = result.unmount;
192+
+ result.unmount = function unmountActing() {
193+
+ act(() => {
194+
+ testingLibraryUnmount();
195+
+ });
196+
+ };
197+
+
198+
return result;
199+
}
200+

0 commit comments

Comments
 (0)