Skip to content

Commit 3ea3061

Browse files
committed
[test] Fix outdated tests
1 parent 161b01f commit 3ea3061

File tree

4 files changed

+7
-9
lines changed

4 files changed

+7
-9
lines changed

packages/material-ui-styles/src/withStyles.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,7 @@ const withStyles = (stylesOrCreator, options = {}) => Component => {
8585

8686
return new Error(
8787
'Material-UI: The `innerRef` prop is deprecated and will be removed in v5. ' +
88-
`Refs are now automatically forwarded to the inner component.${
89-
process.env.NODE_ENV === 'test' ? Date.now() : ''
90-
}`,
88+
'Refs are now automatically forwarded to the inner component.',
9189
);
9290
}),
9391
};

packages/material-ui-styles/src/withStyles.test.js

+1
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ describe('withStyles', () => {
8080

8181
afterEach(() => {
8282
consoleErrorMock.reset();
83+
PropTypes.resetWarningCache();
8384
});
8485

8586
it('is deprecated', () => {

packages/material-ui-styles/src/withTheme.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,7 @@ const withTheme = Component => {
3535

3636
return new Error(
3737
'Material-UI: The `innerRef` prop is deprecated and will be removed in v5. ' +
38-
`Refs are now automatically forwarded to the inner component.${
39-
process.env.NODE_ENV === 'test' ? Date.now() : ''
40-
}`,
38+
'Refs are now automatically forwarded to the inner component.',
4139
);
4240
}),
4341
};

packages/material-ui-styles/src/withTheme.test.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ describe('withTheme', () => {
6262
return null;
6363
}
6464
}
65-
const ThemedTarget = withTheme()(TargetComponent);
65+
const ThemedTarget = withTheme(TargetComponent);
6666

6767
const ref = React.createRef();
6868
mount(
@@ -75,7 +75,7 @@ describe('withTheme', () => {
7575
});
7676

7777
it('forwards refs to React.forwardRef types', () => {
78-
const ThemedTarget = withTheme()(
78+
const ThemedTarget = withTheme(
7979
React.forwardRef((props, ref) => <div {...props} ref={ref} />),
8080
);
8181

@@ -96,10 +96,11 @@ describe('withTheme', () => {
9696

9797
afterEach(() => {
9898
consoleErrorMock.reset();
99+
PropTypes.resetWarningCache();
99100
});
100101

101102
it('is deprecated', () => {
102-
const ThemedDiv = withTheme()('div');
103+
const ThemedDiv = withTheme('div');
103104

104105
mount(
105106
<>

0 commit comments

Comments
 (0)