forked from mui/material-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreact-next.diff
More file actions
198 lines (192 loc) · 9.58 KB
/
Copy pathreact-next.diff
File metadata and controls
198 lines (192 loc) · 9.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
diff --git a/babel.config.js b/babel.config.js
index ac044fb372..4d59b97096 100644
--- a/babel.config.js
+++ b/babel.config.js
@@ -41,7 +41,13 @@ module.exports = function getBabelConfig(api) {
shippedProposals: api.env('modern'),
},
],
- '@babel/preset-react',
+ [
+ '@babel/preset-react',
+ {
+ // default in Babel 8
+ runtime: 'automatic',
+ },
+ ],
'@babel/preset-typescript',
];
diff --git a/packages/material-ui-styles/src/ThemeProvider/ThemeProvider.test.js b/packages/material-ui-styles/src/ThemeProvider/ThemeProvider.test.js
index 197b2f77a3..f1ead08079 100644
--- a/packages/material-ui-styles/src/ThemeProvider/ThemeProvider.test.js
+++ b/packages/material-ui-styles/src/ThemeProvider/ThemeProvider.test.js
@@ -127,11 +127,7 @@ describe('ThemeProvider', () => {
<div />
</ThemeProvider>,
);
- }).toErrorDev([
- 'However, no outer theme is present.',
- // strict mode renders twice
- 'However, no outer theme is present.',
- ]);
+ }).toErrorDev(['However, no outer theme is present.']);
});
it('should warn about wrong theme function', () => {
@@ -144,11 +140,7 @@ describe('ThemeProvider', () => {
,
</ThemeProvider>,
);
- }).toErrorDev([
- 'Material-UI: You should return an object from your theme function',
- // strict mode renders twice
- 'Material-UI: You should return an object from your theme function',
- ]);
+ }).toErrorDev(['Material-UI: You should return an object from your theme function']);
});
});
});
diff --git a/packages/material-ui-styles/src/useThemeVariants/useThemeVariants.test.js b/packages/material-ui-styles/src/useThemeVariants/useThemeVariants.test.js
index 2ab151c6c8..6db6326d77 100644
--- a/packages/material-ui-styles/src/useThemeVariants/useThemeVariants.test.js
+++ b/packages/material-ui-styles/src/useThemeVariants/useThemeVariants.test.js
@@ -135,11 +135,6 @@ describe('useThemeVariants', () => {
</ThemeProvider>,
),
).toErrorDev([
- // strict mode renders twice
- [
- `Material-UI: You are using a variant value \`test\` for which you didn't define styles.`,
- `Please create a new variant matcher in your theme for this variant. To learn more about matchers visit https://next.material-ui.com/r/custom-component-variants.`,
- ].join('\n'),
[
`Material-UI: You are using a variant value \`test\` for which you didn't define styles.`,
`Please create a new variant matcher in your theme for this variant. To learn more about matchers visit https://next.material-ui.com/r/custom-component-variants.`,
diff --git a/packages/material-ui/src/Autocomplete/Autocomplete.test.js b/packages/material-ui/src/Autocomplete/Autocomplete.test.js
index 07345638e7..acfecbdf3e 100644
--- a/packages/material-ui/src/Autocomplete/Autocomplete.test.js
+++ b/packages/material-ui/src/Autocomplete/Autocomplete.test.js
@@ -1176,8 +1176,6 @@ describe('<Autocomplete />', () => {
fireEvent.change(textbox, { target: { value: 'a' } });
fireEvent.keyDown(textbox, { key: 'Enter' });
}).toErrorDev([
- 'Material-UI: The `getOptionLabel` method of Autocomplete returned undefined instead of a string',
- // strict mode renders twice
'Material-UI: The `getOptionLabel` method of Autocomplete returned undefined instead of a string',
'Material-UI: The `getOptionLabel` method of Autocomplete returned undefined instead of a string',
'Material-UI: The `getOptionLabel` method of Autocomplete returned undefined instead of a string',
@@ -1232,9 +1230,6 @@ describe('<Autocomplete />', () => {
/>,
);
}).toWarnDev([
- 'None of the options match with `"not a good value"`',
- // strict mode renders twice
- 'None of the options match with `"not a good value"`',
'None of the options match with `"not a good value"`',
'None of the options match with `"not a good value"`',
]);
@@ -1260,11 +1255,7 @@ describe('<Autocomplete />', () => {
groupBy={(option) => option.group}
/>,
);
- }).toWarnDev([
- // strict mode renders twice
- 'returns duplicated headers',
- 'returns duplicated headers',
- ]);
+ }).toWarnDev(['returns duplicated headers']);
const options = screen.getAllByRole('option').map((el) => el.textContent);
expect(options).to.have.length(7);
expect(options).to.deep.equal(['A', 'D', 'E', 'B', 'G', 'F', 'C']);
diff --git a/packages/material-ui/src/Breadcrumbs/Breadcrumbs.test.js b/packages/material-ui/src/Breadcrumbs/Breadcrumbs.test.js
index d5c5735ecf..86a4ebdece 100644
--- a/packages/material-ui/src/Breadcrumbs/Breadcrumbs.test.js
+++ b/packages/material-ui/src/Breadcrumbs/Breadcrumbs.test.js
@@ -100,7 +100,6 @@ describe('<Breadcrumbs />', () => {
);
}).toErrorDev([
'Material-UI: You have provided an invalid combination of props to the Breadcrumbs.\nitemsAfterCollapse={2} + itemsBeforeCollapse={2} >= maxItems={3}',
- 'Material-UI: You have provided an invalid combination of props to the Breadcrumbs.\nitemsAfterCollapse={2} + itemsBeforeCollapse={2} >= maxItems={3}',
]);
expect(screen.getAllByRole('listitem', { hidden: false })).to.have.length(4);
expect(screen.getByRole('list')).to.have.text('first/second/third/fourth');
diff --git a/packages/material-ui/src/ClickAwayListener/ClickAwayListener.test.js b/packages/material-ui/src/ClickAwayListener/ClickAwayListener.test.js
index d78203151f..72ac37571b 100644
--- a/packages/material-ui/src/ClickAwayListener/ClickAwayListener.test.js
+++ b/packages/material-ui/src/ClickAwayListener/ClickAwayListener.test.js
@@ -132,8 +132,7 @@ describe('<ClickAwayListener />', () => {
expect(handleClickAway.callCount).to.equal(0);
fireEvent.click(getByText('Stop inside a portal'));
- // True-negative, we don't have enough information to do otherwise.
- expect(handleClickAway.callCount).to.equal(1);
+ expect(handleClickAway.callCount).to.equal(0);
});
});
diff --git a/packages/material-ui/src/Tabs/Tabs.test.js b/packages/material-ui/src/Tabs/Tabs.test.js
index d629210cde..f53f50970f 100644
--- a/packages/material-ui/src/Tabs/Tabs.test.js
+++ b/packages/material-ui/src/Tabs/Tabs.test.js
@@ -90,9 +90,6 @@ describe('<Tabs />', () => {
expect(() => {
render(<Tabs value={0} centered variant="scrollable" />);
}).toErrorDev([
- 'Material-UI: You can not use the `centered={true}` and `variant="scrollable"`',
- // StrictMode renders twice
- 'Material-UI: You can not use the `centered={true}` and `variant="scrollable"`',
'Material-UI: You can not use the `centered={true}` and `variant="scrollable"`',
'Material-UI: You can not use the `centered={true}` and `variant="scrollable"`',
]);
diff --git a/packages/material-ui/src/TextareaAutosize/TextareaAutosize.test.js b/packages/material-ui/src/TextareaAutosize/TextareaAutosize.test.js
index 9cd267a0c0..7323483c87 100644
--- a/packages/material-ui/src/TextareaAutosize/TextareaAutosize.test.js
+++ b/packages/material-ui/src/TextareaAutosize/TextareaAutosize.test.js
@@ -255,12 +255,7 @@ describe('<TextareaAutosize />', () => {
expect(() => {
forceUpdate();
- }).toErrorDev([
- 'Material-UI: Too many re-renders.',
- // strict mode renders twice
- 'Material-UI: Too many re-renders.',
- 'Material-UI: Too many re-renders.',
- ]);
+ }).toErrorDev(['Material-UI: Too many re-renders.']);
});
});
});
diff --git a/packages/material-ui/src/internal/SwitchBase.test.js b/packages/material-ui/src/internal/SwitchBase.test.js
index 8c8f59a9d8..657a5e57bc 100644
--- a/packages/material-ui/src/internal/SwitchBase.test.js
+++ b/packages/material-ui/src/internal/SwitchBase.test.js
@@ -366,7 +366,7 @@ describe('<SwitchBase />', () => {
setProps({ checked: true });
global['didWarnControlledToUncontrolled'] = true;
}).toErrorDev([
- 'Warning: A component is changing an uncontrolled input of type checkbox to be controlled.',
+ 'Warning: A component is changing an uncontrolled input to be controlled.',
'Material-UI: A component is changing the uncontrolled checked state of SwitchBase to be controlled.',
]);
});
@@ -387,7 +387,7 @@ describe('<SwitchBase />', () => {
setProps({ checked: undefined });
global['didWarnControlledToUncontrolled'] = true;
}).toErrorDev([
- 'Warning: A component is changing a controlled input of type checkbox to be uncontrolled.',
+ 'Warning: A component is changing a controlled input to be uncontrolled',
'Material-UI: A component is changing the controlled checked state of SwitchBase to be uncontrolled.',
]);
});
diff --git a/packages/material-ui/src/useMediaQuery/useMediaQuery.test.js b/packages/material-ui/src/useMediaQuery/useMediaQuery.test.js
index 25dc48c4c1..b33af6309c 100644
--- a/packages/material-ui/src/useMediaQuery/useMediaQuery.test.js
+++ b/packages/material-ui/src/useMediaQuery/useMediaQuery.test.js
@@ -277,11 +277,7 @@ describe('useMediaQuery', () => {
expect(() => {
render(<MyComponent />);
- }).toErrorDev([
- 'Material-UI: The `query` argument provided is invalid',
- // logs warning twice in StrictMode
- 'Material-UI: The `query` argument provided is invalid',
- ]);
+ }).toErrorDev(['Material-UI: The `query` argument provided is invalid']);
});
});
});