From bf5b3ea49b2e92dd58cfed9b20830dad41a71377 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 8 Apr 2020 22:25:25 +0200 Subject: [PATCH 01/12] temp: use react@next --- package.json | 9 +++++-- yarn.lock | 71 ++++++++++++++++++++++++++-------------------------- 2 files changed, 43 insertions(+), 37 deletions(-) diff --git a/package.json b/package.json index 8b9a7afb7e8958..a110eeb9be9264 100644 --- a/package.json +++ b/package.json @@ -91,7 +91,7 @@ "dom-accessibility-api": "^0.4.3", "dtslint": "^3.2.0", "enzyme": "^3.9.0", - "enzyme-adapter-react-16": "^1.14.0", + "enzyme-adapter-react-16": "npm:@eps1lon/enzyme-adapter-react-next@0.0.1", "eslint": "^6.8.0", "eslint-config-airbnb": "^18.1.0", "eslint-config-prettier": "^6.2.0", @@ -163,7 +163,12 @@ "**/@babel/runtime": "^7.8.4", "**/@babel/types": "^7.8.6", "**/hoist-non-react-statics": "^3.3.2", - "**/next/terser": "^4.1.2" + "**/next/terser": "^4.1.2", + "react": "0.0.0-d7382b6c4", + "react-dom": "0.0.0-d7382b6c4", + "react-is": "0.0.0-d7382b6c4", + "react-test-renderer": "0.0.0-d7382b6c4", + "scheduler": "0.0.0-d7382b6c4" }, "nyc": { "include": [ diff --git a/yarn.lock b/yarn.lock index 907375f9de80b3..6c0acf350f972b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6687,10 +6687,10 @@ envinfo@^7.3.1: resolved "https://registry.yarnpkg.com/envinfo/-/envinfo-7.5.0.tgz#91410bb6db262fb4f1409bd506e9ff57e91023f4" integrity sha512-jDgnJaF/Btomk+m3PZDTTCb5XIIIX3zYItnCRfF73zVgvinLoRomuhi75Y4su0PtQxWz4v66XnLLckyvyJTOIQ== -enzyme-adapter-react-16@^1.14.0: - version "1.15.2" - resolved "https://registry.yarnpkg.com/enzyme-adapter-react-16/-/enzyme-adapter-react-16-1.15.2.tgz#b16db2f0ea424d58a808f9df86ab6212895a4501" - integrity sha512-SkvDrb8xU3lSxID8Qic9rB8pvevDbLybxPK6D/vW7PrT0s2Cl/zJYuXvsd1EBTz0q4o3iqG3FJhpYz3nUNpM2Q== +"enzyme-adapter-react-16@npm:@eps1lon/enzyme-adapter-react-next@0.0.1": + version "0.0.1" + resolved "https://registry.yarnpkg.com/@eps1lon/enzyme-adapter-react-next/-/enzyme-adapter-react-next-0.0.1.tgz#e44d436323a00d8065788e3ab4493efed216edce" + integrity sha512-oGecpGf84lE3jpsI48HZhT4TtuVeHpKDXYvrsGVYBvLJS7LT3mCB1R4Etrcg5SnCVwxrNLRKiquHo5hXBsKJjg== dependencies: enzyme-adapter-utils "^1.13.0" enzyme-shallow-equal "^1.0.1" @@ -13523,15 +13523,14 @@ react-docgen@^5.0.0-beta.1: node-dir "^0.1.10" strip-indent "^3.0.0" -react-dom@^16.13.0: - version "16.13.1" - resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.13.1.tgz#c1bd37331a0486c078ee54c4740720993b2e0e7f" - integrity sha512-81PIMmVLnCNLO/fFOQxdQkvEq/+Hfpv24XNJfpyZhTRfO0QcmQIF/PgCa1zCOj2w1hrn12MFLyaJ/G0+Mxtfag== +react-dom@0.0.0-d7382b6c4, react-dom@^16.13.0: + version "0.0.0-d7382b6c4" + resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-0.0.0-d7382b6c4.tgz#45ed7e6aa7dce26f9993b3a276536374f697ce1f" + integrity sha512-MUThsXBPQgF3d93BPjMjlsCmJvK14YmJ3ZzRUwUhtp2eDSAfsvcNxL9soS79X466RoOBVCe7DnoNJodT7to2DQ== dependencies: loose-envify "^1.1.0" object-assign "^4.1.1" - prop-types "^15.6.2" - scheduler "^0.19.1" + scheduler "0.0.0-d7382b6c4" react-double-scrollbar@0.0.15: version "0.0.15" @@ -13573,15 +13572,10 @@ react-frame-component@^4.1.1: resolved "https://registry.yarnpkg.com/react-frame-component/-/react-frame-component-4.1.1.tgz#ea8f7c518ef6b5ad72146dd1f648752369826894" integrity sha512-NfJp90AvYA1R6+uSYafQ+n+UM2HjHqi4WGHeprVXa6quU9d8o6ZFRzQ36uemY82dlkZFzf2jigFx6E4UzNFajA== -react-is@16.8.6: - version "16.8.6" - resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.8.6.tgz#5bbc1e2d29141c9fbdfed456343fe2bc430a6a16" - integrity sha512-aUk3bHfZ2bRSVFFbbeVS4i+lNPZr3/WM5jT2J5omUVV1zzcs1nAaf3l51ctA5FFvCRbhrH0bdAsRRQddFJZPtA== - -react-is@^16.12.0, react-is@^16.13.0, react-is@^16.6.0, react-is@^16.7.0, react-is@^16.8.0, react-is@^16.8.1, react-is@^16.8.4, react-is@^16.8.6, react-is@^16.9.0: - version "16.13.1" - resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" - integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== +react-is@0.0.0-d7382b6c4, react-is@16.8.6, react-is@^16.12.0, react-is@^16.13.0, react-is@^16.6.0, react-is@^16.7.0, react-is@^16.8.0, react-is@^16.8.1, react-is@^16.8.4, react-is@^16.8.6, react-is@^16.9.0: + version "0.0.0-d7382b6c4" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-0.0.0-d7382b6c4.tgz#142be982da7f1eff581ba606c559737f0999df7e" + integrity sha512-I1+w6U9FtSIVg6KlBA9WcVmsRda5RxaLdYNC9dIRFikQhaEDg5OHWUVspmB5dW7E1q3kObP4ZxD5CziHI8KWpQ== react-jss@^10.1.1: version "10.1.1" @@ -13662,6 +13656,14 @@ react-router@5.1.2, react-router@^5.0.0: tiny-invariant "^1.0.2" tiny-warning "^1.0.0" +react-shallow-renderer@^16.13.1: + version "16.13.1" + resolved "https://registry.yarnpkg.com/react-shallow-renderer/-/react-shallow-renderer-16.13.1.tgz#4cfd6dc0f05a8d4d261ff7a80e9b88f15491a00a" + integrity sha512-hLmExm5/ZnjodLgm/4oxYw4i7fL6LLPhbO9mF/4tmaZUurtLrp2aSeDHZmRk0SVCHXPz0VaEbb3Dqi5J7odz7Q== + dependencies: + object-assign "^4.1.1" + react-is "^16.12.0" + react-smooth@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/react-smooth/-/react-smooth-1.0.5.tgz#94ae161d7951cdd893ccb7099d031d342cb762ad" @@ -13711,15 +13713,15 @@ react-swipeable-views@^0.13.9: react-swipeable-views-utils "^0.13.9" warning "^4.0.1" -react-test-renderer@^16.0.0-0, react-test-renderer@^16.13.0: - version "16.13.1" - resolved "https://registry.yarnpkg.com/react-test-renderer/-/react-test-renderer-16.13.1.tgz#de25ea358d9012606de51e012d9742e7f0deabc1" - integrity sha512-Sn2VRyOK2YJJldOqoh8Tn/lWQ+ZiKhyZTPtaO0Q6yNj+QDbmRkVFap6pZPy3YQk8DScRDfyqm/KxKYP9gCMRiQ== +react-test-renderer@0.0.0-d7382b6c4, react-test-renderer@^16.0.0-0, react-test-renderer@^16.13.0: + version "0.0.0-d7382b6c4" + resolved "https://registry.yarnpkg.com/react-test-renderer/-/react-test-renderer-0.0.0-d7382b6c4.tgz#0e6aaff72cd44d76b0c22ad1ea2859a593e4204f" + integrity sha512-WRByveBdLaJyvLLOGxIkYte8w3vUmx0WP6R7+afK9mTovCHKluFle3gNmyJkulNDjkjpE891DCFRlVmiD5msdw== dependencies: object-assign "^4.1.1" - prop-types "^15.6.2" - react-is "^16.8.6" - scheduler "^0.19.1" + react-is "0.0.0-d7382b6c4" + react-shallow-renderer "^16.13.1" + scheduler "0.0.0-d7382b6c4" react-text-mask@^5.0.2: version "5.4.3" @@ -13768,14 +13770,13 @@ react-window@^1.8.5: "@babel/runtime" "^7.0.0" memoize-one ">=3.1.1 <6" -react@^16.13.0: - version "16.13.1" - resolved "https://registry.yarnpkg.com/react/-/react-16.13.1.tgz#2e818822f1a9743122c063d6410d85c1e3afe48e" - integrity sha512-YMZQQq32xHLX0bz5Mnibv1/LHb3Sqzngu7xstSM+vrkE5Kzr9xE0yMByK5kMoTK30YVJE61WfbxIFFvfeDKT1w== +react@0.0.0-d7382b6c4, react@^16.13.0: + version "0.0.0-d7382b6c4" + resolved "https://registry.yarnpkg.com/react/-/react-0.0.0-d7382b6c4.tgz#332f23a767144a7be261ff92b5537238d79a2d40" + integrity sha512-cA0aW/k5CPPk1abKbQ9xZzbKxcvbYA2KxI8eopQifvW8+r9l0zS3m/2pXPauEJ6UmJw2ASr0WH7qjleOegCi/g== dependencies: loose-envify "^1.1.0" object-assign "^4.1.1" - prop-types "^15.6.2" read-cmd-shim@^1.0.1: version "1.0.1" @@ -14648,10 +14649,10 @@ saxes@^5.0.0: dependencies: xmlchars "^2.2.0" -scheduler@^0.19.1: - version "0.19.1" - resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.19.1.tgz#4f3e2ed2c1a7d65681f4c854fa8c5a1ccb40f196" - integrity sha512-n/zwRWRYSUj0/3g/otKDRPMh6qv2SYMWNq85IEa8iZyAv8od9zDYpGSnpBEjNgcMNq6Scbu5KfIPxNF72R/2EA== +scheduler@0.0.0-d7382b6c4, scheduler@^0.19.1: + version "0.0.0-d7382b6c4" + resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.0.0-d7382b6c4.tgz#e95e54348672c0ad9cdc705ffd1b1622d598fc81" + integrity sha512-eBGEL2GmEpiwg1kHT4Yt/j5n/1V/RzQxlBvvkDIr8bQpIl7eSgvvSn4xLwfpKOtvQOMUlO7hyb8JQUrNzSeeeQ== dependencies: loose-envify "^1.1.0" object-assign "^4.1.1" From 32c69afa12d0741e52c82c2218a33baa7aadcec7 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 8 Apr 2020 22:43:51 +0200 Subject: [PATCH 02/12] [Paper] Move elevation warning to propTypes --- packages/material-ui/src/Paper/Paper.js | 19 ++++++--- packages/material-ui/src/Paper/Paper.test.js | 45 ++++++++++++-------- 2 files changed, 39 insertions(+), 25 deletions(-) diff --git a/packages/material-ui/src/Paper/Paper.js b/packages/material-ui/src/Paper/Paper.js index 99b78c1bbb792d..6c249a4742d532 100644 --- a/packages/material-ui/src/Paper/Paper.js +++ b/packages/material-ui/src/Paper/Paper.js @@ -1,6 +1,7 @@ import * as React from 'react'; import PropTypes from 'prop-types'; import clsx from 'clsx'; +import { chainPropTypes } from '@material-ui/utils'; import withStyles from '../styles/withStyles'; export const styles = (theme) => { @@ -41,12 +42,6 @@ const Paper = React.forwardRef(function Paper(props, ref) { ...other } = props; - if (process.env.NODE_ENV !== 'production') { - if (classes[`elevation${elevation}`] === undefined) { - console.error(`Material-UI: this elevation \`${elevation}\` is not implemented.`); - } - } - return ( { + const { classes, elevation } = props; + // in case `withStyles` fails to inject we don't need this warning + if (classes === undefined) { + return null; + } + if (elevation != null && classes[`elevation${elevation}`] === undefined) { + return new Error(`Material-UI: this elevation \`${elevation}\` is not implemented.`); + } + return null; + }), /** * If `true`, rounded corners are disabled. */ diff --git a/packages/material-ui/src/Paper/Paper.test.js b/packages/material-ui/src/Paper/Paper.test.js index c7d511eab567c4..82314ecbd426a1 100644 --- a/packages/material-ui/src/Paper/Paper.test.js +++ b/packages/material-ui/src/Paper/Paper.test.js @@ -1,6 +1,7 @@ import * as React from 'react'; import { assert } from 'chai'; import { createMount, createShallow, getClasses } from '@material-ui/core/test-utils'; +import * as PropTypes from 'prop-types'; import describeConformance from '../test-utils/describeConformance'; import Paper from './Paper'; import { createMuiTheme, ThemeProvider } from '../styles'; @@ -11,14 +12,6 @@ describe('', () => { let shallow; let classes; - beforeEach(() => { - consoleErrorMock.spy(); - }); - - afterEach(() => { - consoleErrorMock.reset(); - }); - before(() => { mount = createMount({ strict: true }); shallow = createShallow({ dive: true }); @@ -77,16 +70,6 @@ describe('', () => { ); }); - it('warns if the given `elevation` is not implemented in the theme', () => { - mount(); - - assert.strictEqual(consoleErrorMock.callCount(), 1); - assert.include( - consoleErrorMock.messages()[0], - 'Material-UI: this elevation `25` is not implemented.', - ); - }); - it('allows custom elevations via theme.shadows', () => { const theme = createMuiTheme(); theme.shadows.push('20px 20px'); @@ -98,4 +81,30 @@ describe('', () => { assert.strictEqual(wrapper.find('div[data-testid="paper"]').hasClass('custom-elevation'), true); }); + + describe('warnings', () => { + beforeEach(() => { + consoleErrorMock.spy(); + PropTypes.resetWarningCache(); + }); + + afterEach(() => { + consoleErrorMock.reset(); + }); + + it('warns if the given `elevation` is not implemented in the theme', () => { + PropTypes.checkPropTypes( + Paper.Naked.propTypes, + { classes: { elevation24: 'elevation-24', elevation26: 'elevation-26' }, elevation: 25 }, + 'prop', + 'MockedPaper', + ); + + assert.strictEqual(consoleErrorMock.callCount(), 1); + assert.include( + consoleErrorMock.messages()[0], + 'Material-UI: this elevation `25` is not implemented.', + ); + }); + }); }); From b9dc34eefbdd5c1c3787cd6bbf27d4c6a6d73bbe Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 8 Apr 2020 22:44:05 +0200 Subject: [PATCH 03/12] [Popover] Use checkPropTypes over .propTypes --- .../material-ui/src/Popover/Popover.test.js | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/packages/material-ui/src/Popover/Popover.test.js b/packages/material-ui/src/Popover/Popover.test.js index 644c8476333312..8e7651c3402a81 100644 --- a/packages/material-ui/src/Popover/Popover.test.js +++ b/packages/material-ui/src/Popover/Popover.test.js @@ -2,6 +2,7 @@ import * as React from 'react'; import { assert, expect } from 'chai'; import { spy, stub, useFakeTimers } from 'sinon'; import { createMount, findOutermostIntrinsic, getClasses } from '@material-ui/core/test-utils'; +import * as PropTypes from 'prop-types'; import describeConformance from '../test-utils/describeConformance'; import consoleErrorMock from 'test/utils/consoleErrorMock'; import Grow from '../Grow'; @@ -460,6 +461,7 @@ describe('', () => { describe('warnings', () => { beforeEach(() => { consoleErrorMock.spy(); + PropTypes.resetWarningCache(); }); afterEach(() => { @@ -467,18 +469,29 @@ describe('', () => { }); it('should warn if anchorEl is not valid', () => { - const otherWrapper = mount(); - assert.strictEqual(otherWrapper.find(Modal).props().container, undefined); + PropTypes.checkPropTypes( + Popover.Naked.propTypes, + { classes: {}, open: true }, + 'prop', + 'MockedPopover', + ); + assert.strictEqual(consoleErrorMock.callCount(), 1); assert.include(consoleErrorMock.messages()[0], 'It should be an Element instance'); }); it('warns if a component for the Paper is used that cant hold a ref', () => { - mount(
, elevation: 4 }} />); + PropTypes.checkPropTypes( + Popover.Naked.propTypes, + { ...defaultProps, classes: {}, PaperProps: { component: () =>
, elevation: 4 } }, + 'prop', + 'MockedPopover', + ); + assert.strictEqual(consoleErrorMock.callCount(), 1); assert.include( consoleErrorMock.messages()[0], - 'Warning: Failed prop type: Invalid prop `PaperProps.component` supplied to `ForwardRef(Popover)`. Expected an element type that can hold a ref.', + 'Warning: Failed prop type: Invalid prop `PaperProps.component` supplied to `MockedPopover`. Expected an element type that can hold a ref.', ); }); From 92f245fedc11786451ea60359469046afefda06a Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 8 Apr 2020 22:53:33 +0200 Subject: [PATCH 04/12] test: Fix broken test due to StrictMode change --- .../src/StylesProvider/StylesProvider.test.js | 4 +++- .../src/ThemeProvider/ThemeProvider.test.js | 4 +++- .../material-ui/src/FormControl/FormControl.test.js | 10 +++++++--- packages/material-ui/src/GridList/GridList.test.js | 4 +++- packages/material-ui/src/Hidden/HiddenCss.test.js | 4 +++- .../src/InputAdornment/InputAdornment.test.js | 4 +++- 6 files changed, 22 insertions(+), 8 deletions(-) diff --git a/packages/material-ui-styles/src/StylesProvider/StylesProvider.test.js b/packages/material-ui-styles/src/StylesProvider/StylesProvider.test.js index c3f963406a83dd..74fb6ecf9e7d39 100644 --- a/packages/material-ui-styles/src/StylesProvider/StylesProvider.test.js +++ b/packages/material-ui-styles/src/StylesProvider/StylesProvider.test.js @@ -159,11 +159,13 @@ describe('StylesProvider', () => { , ); - assert.strictEqual(consoleErrorMock.callCount(), 1); + assert.strictEqual(consoleErrorMock.callCount(), 2); assert.include( consoleErrorMock.messages()[0], 'you cannot use the jss and injectFirst props at the same time', ); + // one error per render (twice rendered in StrictMode) + assert.strictEqual(consoleErrorMock.messages()[0], consoleErrorMock.messages()[1]); }); }); }); diff --git a/packages/material-ui-styles/src/ThemeProvider/ThemeProvider.test.js b/packages/material-ui-styles/src/ThemeProvider/ThemeProvider.test.js index 09d0fe20703753..cbdbffcb5364d3 100644 --- a/packages/material-ui-styles/src/ThemeProvider/ThemeProvider.test.js +++ b/packages/material-ui-styles/src/ThemeProvider/ThemeProvider.test.js @@ -67,7 +67,9 @@ describe('ThemeProvider', () => { const text = () => ref.current.textContent; function Test() { const theme = useTheme(); - themes.push(theme); + React.useEffect(() => { + themes.push(theme); + }); return ( diff --git a/packages/material-ui/src/FormControl/FormControl.test.js b/packages/material-ui/src/FormControl/FormControl.test.js index cd734bdc08aa10..d40afa9c5dbb3e 100644 --- a/packages/material-ui/src/FormControl/FormControl.test.js +++ b/packages/material-ui/src/FormControl/FormControl.test.js @@ -3,7 +3,7 @@ import { expect } from 'chai'; import { spy } from 'sinon'; import { createMount, getClasses } from '@material-ui/core/test-utils'; import describeConformance from '../test-utils/describeConformance'; -import { createClientRender } from 'test/utils/createClientRender'; +import { act, createClientRender } from 'test/utils/createClientRender'; import Input from '../Input'; import Select from '../Select'; import FormControl from './FormControl'; @@ -16,7 +16,9 @@ describe('', () => { function TestComponent(props) { const context = useFormControl(); - props.contextCallback(context); + React.useEffect(() => { + props.contextCallback(context); + }); return null; } @@ -101,7 +103,9 @@ describe('', () => { ); expect(readContext.args[0][0]).to.have.property('focused', false); - container.querySelector('input').focus(); + act(() => { + container.querySelector('input').focus(); + }); expect(readContext.args[1][0]).to.have.property('focused', true); setProps({ disabled: true }); diff --git a/packages/material-ui/src/GridList/GridList.test.js b/packages/material-ui/src/GridList/GridList.test.js index 751610999f55db..949b29645d2807 100644 --- a/packages/material-ui/src/GridList/GridList.test.js +++ b/packages/material-ui/src/GridList/GridList.test.js @@ -189,11 +189,13 @@ describe('', () => { , ); - assert.strictEqual(consoleErrorMock.callCount(), 1); + assert.strictEqual(consoleErrorMock.callCount(), 2); assert.include( consoleErrorMock.messages()[0], "Material-UI: the GridList component doesn't accept a Fragment as a child.", ); + // one error per render (twice rendered in StrictMode) + assert.strictEqual(consoleErrorMock.messages()[0], consoleErrorMock.messages()[1]); }); }); }); diff --git a/packages/material-ui/src/Hidden/HiddenCss.test.js b/packages/material-ui/src/Hidden/HiddenCss.test.js index 60bf25c025784f..f39b8cd0a0b302 100644 --- a/packages/material-ui/src/Hidden/HiddenCss.test.js +++ b/packages/material-ui/src/Hidden/HiddenCss.test.js @@ -160,11 +160,13 @@ describe('', () => { , ); - assert.strictEqual(consoleErrorMock.callCount(), 1); + assert.strictEqual(consoleErrorMock.callCount(), 2); assert.include( consoleErrorMock.messages()[0], 'Material-UI: unsupported props received by ``: xxlUp.', ); + // one error per render (twice rendered in StrictMode) + assert.strictEqual(consoleErrorMock.messages()[0], consoleErrorMock.messages()[1]); }); }); }); diff --git a/packages/material-ui/src/InputAdornment/InputAdornment.test.js b/packages/material-ui/src/InputAdornment/InputAdornment.test.js index 01d505fe48747a..71b3fc7ed5cb95 100644 --- a/packages/material-ui/src/InputAdornment/InputAdornment.test.js +++ b/packages/material-ui/src/InputAdornment/InputAdornment.test.js @@ -150,11 +150,13 @@ describe('', () => { /> , ); - expect(consoleErrorMock.callCount()).to.equal(1); + expect(consoleErrorMock.callCount()).to.equal(2); expect(consoleErrorMock.messages()[0]).to.equal( 'Material-UI: The `InputAdornment` variant infers the variant ' + 'prop you do not have to provide one.', ); + // one error per render (twice rendered in StrictMode) + expect(consoleErrorMock.messages()[0]).to.equal(consoleErrorMock.messages()[1]); }); }); }); From 3d77638ac069fa3eb2c87f436c1123a46d18141d Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 8 Apr 2020 22:53:55 +0200 Subject: [PATCH 05/12] test(ci): Use dedicated adapter for react@next --- scripts/use-react-dist-tag.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/use-react-dist-tag.js b/scripts/use-react-dist-tag.js index 8525850ce21484..e155e4838b102b 100644 --- a/scripts/use-react-dist-tag.js +++ b/scripts/use-react-dist-tag.js @@ -45,6 +45,9 @@ async function main(distTag) { packageJson.resolutions[reactPackageName] = version; }); + // https://github.com/enzymejs/enzyme/issues/2358 + packageJson.devDependencies['enzyme-adapter-react-16'] = 'npm:@eps1lon/enzyme-adapter-react-next'; + // CircleCI seemingly times out if it has a newline diff at the end fs.writeFileSync(packageJsonPath, `${JSON.stringify(packageJson, null, 2)}${os.EOL}`); } From 7e892bf3582bbab2c1e3a5e2edb23b11cbe4dfe8 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 8 Apr 2020 22:54:41 +0200 Subject: [PATCH 06/12] Revert "temp: use react@next" This reverts commit bf5b3ea49b2e92dd58cfed9b20830dad41a71377. --- package.json | 9 ++----- yarn.lock | 71 ++++++++++++++++++++++++++-------------------------- 2 files changed, 37 insertions(+), 43 deletions(-) diff --git a/package.json b/package.json index a110eeb9be9264..8b9a7afb7e8958 100644 --- a/package.json +++ b/package.json @@ -91,7 +91,7 @@ "dom-accessibility-api": "^0.4.3", "dtslint": "^3.2.0", "enzyme": "^3.9.0", - "enzyme-adapter-react-16": "npm:@eps1lon/enzyme-adapter-react-next@0.0.1", + "enzyme-adapter-react-16": "^1.14.0", "eslint": "^6.8.0", "eslint-config-airbnb": "^18.1.0", "eslint-config-prettier": "^6.2.0", @@ -163,12 +163,7 @@ "**/@babel/runtime": "^7.8.4", "**/@babel/types": "^7.8.6", "**/hoist-non-react-statics": "^3.3.2", - "**/next/terser": "^4.1.2", - "react": "0.0.0-d7382b6c4", - "react-dom": "0.0.0-d7382b6c4", - "react-is": "0.0.0-d7382b6c4", - "react-test-renderer": "0.0.0-d7382b6c4", - "scheduler": "0.0.0-d7382b6c4" + "**/next/terser": "^4.1.2" }, "nyc": { "include": [ diff --git a/yarn.lock b/yarn.lock index 6c0acf350f972b..907375f9de80b3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6687,10 +6687,10 @@ envinfo@^7.3.1: resolved "https://registry.yarnpkg.com/envinfo/-/envinfo-7.5.0.tgz#91410bb6db262fb4f1409bd506e9ff57e91023f4" integrity sha512-jDgnJaF/Btomk+m3PZDTTCb5XIIIX3zYItnCRfF73zVgvinLoRomuhi75Y4su0PtQxWz4v66XnLLckyvyJTOIQ== -"enzyme-adapter-react-16@npm:@eps1lon/enzyme-adapter-react-next@0.0.1": - version "0.0.1" - resolved "https://registry.yarnpkg.com/@eps1lon/enzyme-adapter-react-next/-/enzyme-adapter-react-next-0.0.1.tgz#e44d436323a00d8065788e3ab4493efed216edce" - integrity sha512-oGecpGf84lE3jpsI48HZhT4TtuVeHpKDXYvrsGVYBvLJS7LT3mCB1R4Etrcg5SnCVwxrNLRKiquHo5hXBsKJjg== +enzyme-adapter-react-16@^1.14.0: + version "1.15.2" + resolved "https://registry.yarnpkg.com/enzyme-adapter-react-16/-/enzyme-adapter-react-16-1.15.2.tgz#b16db2f0ea424d58a808f9df86ab6212895a4501" + integrity sha512-SkvDrb8xU3lSxID8Qic9rB8pvevDbLybxPK6D/vW7PrT0s2Cl/zJYuXvsd1EBTz0q4o3iqG3FJhpYz3nUNpM2Q== dependencies: enzyme-adapter-utils "^1.13.0" enzyme-shallow-equal "^1.0.1" @@ -13523,14 +13523,15 @@ react-docgen@^5.0.0-beta.1: node-dir "^0.1.10" strip-indent "^3.0.0" -react-dom@0.0.0-d7382b6c4, react-dom@^16.13.0: - version "0.0.0-d7382b6c4" - resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-0.0.0-d7382b6c4.tgz#45ed7e6aa7dce26f9993b3a276536374f697ce1f" - integrity sha512-MUThsXBPQgF3d93BPjMjlsCmJvK14YmJ3ZzRUwUhtp2eDSAfsvcNxL9soS79X466RoOBVCe7DnoNJodT7to2DQ== +react-dom@^16.13.0: + version "16.13.1" + resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.13.1.tgz#c1bd37331a0486c078ee54c4740720993b2e0e7f" + integrity sha512-81PIMmVLnCNLO/fFOQxdQkvEq/+Hfpv24XNJfpyZhTRfO0QcmQIF/PgCa1zCOj2w1hrn12MFLyaJ/G0+Mxtfag== dependencies: loose-envify "^1.1.0" object-assign "^4.1.1" - scheduler "0.0.0-d7382b6c4" + prop-types "^15.6.2" + scheduler "^0.19.1" react-double-scrollbar@0.0.15: version "0.0.15" @@ -13572,10 +13573,15 @@ react-frame-component@^4.1.1: resolved "https://registry.yarnpkg.com/react-frame-component/-/react-frame-component-4.1.1.tgz#ea8f7c518ef6b5ad72146dd1f648752369826894" integrity sha512-NfJp90AvYA1R6+uSYafQ+n+UM2HjHqi4WGHeprVXa6quU9d8o6ZFRzQ36uemY82dlkZFzf2jigFx6E4UzNFajA== -react-is@0.0.0-d7382b6c4, react-is@16.8.6, react-is@^16.12.0, react-is@^16.13.0, react-is@^16.6.0, react-is@^16.7.0, react-is@^16.8.0, react-is@^16.8.1, react-is@^16.8.4, react-is@^16.8.6, react-is@^16.9.0: - version "0.0.0-d7382b6c4" - resolved "https://registry.yarnpkg.com/react-is/-/react-is-0.0.0-d7382b6c4.tgz#142be982da7f1eff581ba606c559737f0999df7e" - integrity sha512-I1+w6U9FtSIVg6KlBA9WcVmsRda5RxaLdYNC9dIRFikQhaEDg5OHWUVspmB5dW7E1q3kObP4ZxD5CziHI8KWpQ== +react-is@16.8.6: + version "16.8.6" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.8.6.tgz#5bbc1e2d29141c9fbdfed456343fe2bc430a6a16" + integrity sha512-aUk3bHfZ2bRSVFFbbeVS4i+lNPZr3/WM5jT2J5omUVV1zzcs1nAaf3l51ctA5FFvCRbhrH0bdAsRRQddFJZPtA== + +react-is@^16.12.0, react-is@^16.13.0, react-is@^16.6.0, react-is@^16.7.0, react-is@^16.8.0, react-is@^16.8.1, react-is@^16.8.4, react-is@^16.8.6, react-is@^16.9.0: + version "16.13.1" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" + integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== react-jss@^10.1.1: version "10.1.1" @@ -13656,14 +13662,6 @@ react-router@5.1.2, react-router@^5.0.0: tiny-invariant "^1.0.2" tiny-warning "^1.0.0" -react-shallow-renderer@^16.13.1: - version "16.13.1" - resolved "https://registry.yarnpkg.com/react-shallow-renderer/-/react-shallow-renderer-16.13.1.tgz#4cfd6dc0f05a8d4d261ff7a80e9b88f15491a00a" - integrity sha512-hLmExm5/ZnjodLgm/4oxYw4i7fL6LLPhbO9mF/4tmaZUurtLrp2aSeDHZmRk0SVCHXPz0VaEbb3Dqi5J7odz7Q== - dependencies: - object-assign "^4.1.1" - react-is "^16.12.0" - react-smooth@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/react-smooth/-/react-smooth-1.0.5.tgz#94ae161d7951cdd893ccb7099d031d342cb762ad" @@ -13713,15 +13711,15 @@ react-swipeable-views@^0.13.9: react-swipeable-views-utils "^0.13.9" warning "^4.0.1" -react-test-renderer@0.0.0-d7382b6c4, react-test-renderer@^16.0.0-0, react-test-renderer@^16.13.0: - version "0.0.0-d7382b6c4" - resolved "https://registry.yarnpkg.com/react-test-renderer/-/react-test-renderer-0.0.0-d7382b6c4.tgz#0e6aaff72cd44d76b0c22ad1ea2859a593e4204f" - integrity sha512-WRByveBdLaJyvLLOGxIkYte8w3vUmx0WP6R7+afK9mTovCHKluFle3gNmyJkulNDjkjpE891DCFRlVmiD5msdw== +react-test-renderer@^16.0.0-0, react-test-renderer@^16.13.0: + version "16.13.1" + resolved "https://registry.yarnpkg.com/react-test-renderer/-/react-test-renderer-16.13.1.tgz#de25ea358d9012606de51e012d9742e7f0deabc1" + integrity sha512-Sn2VRyOK2YJJldOqoh8Tn/lWQ+ZiKhyZTPtaO0Q6yNj+QDbmRkVFap6pZPy3YQk8DScRDfyqm/KxKYP9gCMRiQ== dependencies: object-assign "^4.1.1" - react-is "0.0.0-d7382b6c4" - react-shallow-renderer "^16.13.1" - scheduler "0.0.0-d7382b6c4" + prop-types "^15.6.2" + react-is "^16.8.6" + scheduler "^0.19.1" react-text-mask@^5.0.2: version "5.4.3" @@ -13770,13 +13768,14 @@ react-window@^1.8.5: "@babel/runtime" "^7.0.0" memoize-one ">=3.1.1 <6" -react@0.0.0-d7382b6c4, react@^16.13.0: - version "0.0.0-d7382b6c4" - resolved "https://registry.yarnpkg.com/react/-/react-0.0.0-d7382b6c4.tgz#332f23a767144a7be261ff92b5537238d79a2d40" - integrity sha512-cA0aW/k5CPPk1abKbQ9xZzbKxcvbYA2KxI8eopQifvW8+r9l0zS3m/2pXPauEJ6UmJw2ASr0WH7qjleOegCi/g== +react@^16.13.0: + version "16.13.1" + resolved "https://registry.yarnpkg.com/react/-/react-16.13.1.tgz#2e818822f1a9743122c063d6410d85c1e3afe48e" + integrity sha512-YMZQQq32xHLX0bz5Mnibv1/LHb3Sqzngu7xstSM+vrkE5Kzr9xE0yMByK5kMoTK30YVJE61WfbxIFFvfeDKT1w== dependencies: loose-envify "^1.1.0" object-assign "^4.1.1" + prop-types "^15.6.2" read-cmd-shim@^1.0.1: version "1.0.1" @@ -14649,10 +14648,10 @@ saxes@^5.0.0: dependencies: xmlchars "^2.2.0" -scheduler@0.0.0-d7382b6c4, scheduler@^0.19.1: - version "0.0.0-d7382b6c4" - resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.0.0-d7382b6c4.tgz#e95e54348672c0ad9cdc705ffd1b1622d598fc81" - integrity sha512-eBGEL2GmEpiwg1kHT4Yt/j5n/1V/RzQxlBvvkDIr8bQpIl7eSgvvSn4xLwfpKOtvQOMUlO7hyb8JQUrNzSeeeQ== +scheduler@^0.19.1: + version "0.19.1" + resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.19.1.tgz#4f3e2ed2c1a7d65681f4c854fa8c5a1ccb40f196" + integrity sha512-n/zwRWRYSUj0/3g/otKDRPMh6qv2SYMWNq85IEa8iZyAv8od9zDYpGSnpBEjNgcMNq6Scbu5KfIPxNF72R/2EA== dependencies: loose-envify "^1.1.0" object-assign "^4.1.1" From a93c076127706eeae7264a6f579cbd75f162786d Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 8 Apr 2020 22:55:36 +0200 Subject: [PATCH 07/12] temp: Test with react-dist-tag: next in CI --- .circleci/config.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8a7522064b9485..5a215b58cd12ae 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -210,6 +210,8 @@ workflows: - test_unit: requires: - checkout + # REVERT_ME_OR_JUST_KIDDING_IT_WILL_BE_FINE + react-dist-tag: next - test_static: requires: - checkout @@ -219,6 +221,8 @@ workflows: - test_browser: requires: - checkout + # REVERT_ME_OR_JUST_KIDDING_IT_WILL_BE_FINE + react-dist-tag: next - test_regressions: requires: - test_unit From c281c2396c8afe998ea3d5a7791ceed6bd730452 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 8 Apr 2020 23:14:59 +0200 Subject: [PATCH 08/12] fix: no idea why circleci times out --- .circleci/config.yml | 2 ++ scripts/use-react-dist-tag.js | 3 +-- scripts/use-typescript-dist-tag.js | 4 +--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5a215b58cd12ae..d21255adb80b21 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -35,6 +35,7 @@ commands: node scripts/use-react-dist-tag # log a patch for maintainers who want to check out this change git diff HEAD + exit 0 - restore_cache: keys: - v2-yarn-sha-{{ checksum "yarn.lock" }} @@ -153,6 +154,7 @@ jobs: node scripts/use-typescript-dist-tag # log a patch for maintainers who want to check out this change git diff HEAD + exit 0 - install_js - run: name: Tests TypeScript definitions diff --git a/scripts/use-react-dist-tag.js b/scripts/use-react-dist-tag.js index e155e4838b102b..c20e7eda433911 100644 --- a/scripts/use-react-dist-tag.js +++ b/scripts/use-react-dist-tag.js @@ -9,7 +9,6 @@ */ const childProcess = require('child_process'); const fs = require('fs'); -const os = require('os'); const path = require('path'); const { promisify } = require('util'); @@ -49,7 +48,7 @@ async function main(distTag) { packageJson.devDependencies['enzyme-adapter-react-16'] = 'npm:@eps1lon/enzyme-adapter-react-next'; // CircleCI seemingly times out if it has a newline diff at the end - fs.writeFileSync(packageJsonPath, `${JSON.stringify(packageJson, null, 2)}${os.EOL}`); + fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2)); } main(process.env.REACT_DIST_TAG).catch((error) => { diff --git a/scripts/use-typescript-dist-tag.js b/scripts/use-typescript-dist-tag.js index 8656a31d4d1184..e5747c01589f96 100644 --- a/scripts/use-typescript-dist-tag.js +++ b/scripts/use-typescript-dist-tag.js @@ -11,7 +11,6 @@ */ const childProcess = require('child_process'); const fs = require('fs'); -const os = require('os'); const path = require('path'); const { promisify } = require('util'); @@ -44,8 +43,7 @@ async function main(distTag) { packageJson.devDependencies.typescript = version; packageJson.resolutions['**/dtslint/typescript'] = version; - // CircleCI seemingly times out if it has a newline diff at the end - fs.writeFileSync(packageJsonPath, `${JSON.stringify(packageJson, null, 2)}${os.EOL}`); + fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2)); } main(process.env.TYPESCRIPT_DIST_TAG).catch((error) => { From dd7b654cdc275a92192fdb0b9996b0b8333b722e Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 8 Apr 2020 23:34:16 +0200 Subject: [PATCH 09/12] Revert "fix: no idea why circleci times out" This reverts commit c281c2396c8afe998ea3d5a7791ceed6bd730452. --- .circleci/config.yml | 2 -- scripts/use-react-dist-tag.js | 3 ++- scripts/use-typescript-dist-tag.js | 4 +++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d21255adb80b21..5a215b58cd12ae 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -35,7 +35,6 @@ commands: node scripts/use-react-dist-tag # log a patch for maintainers who want to check out this change git diff HEAD - exit 0 - restore_cache: keys: - v2-yarn-sha-{{ checksum "yarn.lock" }} @@ -154,7 +153,6 @@ jobs: node scripts/use-typescript-dist-tag # log a patch for maintainers who want to check out this change git diff HEAD - exit 0 - install_js - run: name: Tests TypeScript definitions diff --git a/scripts/use-react-dist-tag.js b/scripts/use-react-dist-tag.js index c20e7eda433911..e155e4838b102b 100644 --- a/scripts/use-react-dist-tag.js +++ b/scripts/use-react-dist-tag.js @@ -9,6 +9,7 @@ */ const childProcess = require('child_process'); const fs = require('fs'); +const os = require('os'); const path = require('path'); const { promisify } = require('util'); @@ -48,7 +49,7 @@ async function main(distTag) { packageJson.devDependencies['enzyme-adapter-react-16'] = 'npm:@eps1lon/enzyme-adapter-react-next'; // CircleCI seemingly times out if it has a newline diff at the end - fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2)); + fs.writeFileSync(packageJsonPath, `${JSON.stringify(packageJson, null, 2)}${os.EOL}`); } main(process.env.REACT_DIST_TAG).catch((error) => { diff --git a/scripts/use-typescript-dist-tag.js b/scripts/use-typescript-dist-tag.js index e5747c01589f96..8656a31d4d1184 100644 --- a/scripts/use-typescript-dist-tag.js +++ b/scripts/use-typescript-dist-tag.js @@ -11,6 +11,7 @@ */ const childProcess = require('child_process'); const fs = require('fs'); +const os = require('os'); const path = require('path'); const { promisify } = require('util'); @@ -43,7 +44,8 @@ async function main(distTag) { packageJson.devDependencies.typescript = version; packageJson.resolutions['**/dtslint/typescript'] = version; - fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2)); + // CircleCI seemingly times out if it has a newline diff at the end + fs.writeFileSync(packageJsonPath, `${JSON.stringify(packageJson, null, 2)}${os.EOL}`); } main(process.env.TYPESCRIPT_DIST_TAG).catch((error) => { From 5eb89b121402d47352dfcce9f1fcd543c690ec89 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 8 Apr 2020 23:36:02 +0200 Subject: [PATCH 10/12] fix: disable pager when printing patches --- .circleci/config.yml | 4 ++-- scripts/use-react-dist-tag.js | 2 +- scripts/use-typescript-dist-tag.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5a215b58cd12ae..7a6a09aea7ad24 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -34,7 +34,7 @@ commands: command: | node scripts/use-react-dist-tag # log a patch for maintainers who want to check out this change - git diff HEAD + git --no-pager diff HEAD - restore_cache: keys: - v2-yarn-sha-{{ checksum "yarn.lock" }} @@ -152,7 +152,7 @@ jobs: command: | node scripts/use-typescript-dist-tag # log a patch for maintainers who want to check out this change - git diff HEAD + git --no-pager diff HEAD - install_js - run: name: Tests TypeScript definitions diff --git a/scripts/use-react-dist-tag.js b/scripts/use-react-dist-tag.js index e155e4838b102b..02a261738fd00c 100644 --- a/scripts/use-react-dist-tag.js +++ b/scripts/use-react-dist-tag.js @@ -48,7 +48,7 @@ async function main(distTag) { // https://github.com/enzymejs/enzyme/issues/2358 packageJson.devDependencies['enzyme-adapter-react-16'] = 'npm:@eps1lon/enzyme-adapter-react-next'; - // CircleCI seemingly times out if it has a newline diff at the end + // add newline for clean diff fs.writeFileSync(packageJsonPath, `${JSON.stringify(packageJson, null, 2)}${os.EOL}`); } diff --git a/scripts/use-typescript-dist-tag.js b/scripts/use-typescript-dist-tag.js index 8656a31d4d1184..68c63509481a0d 100644 --- a/scripts/use-typescript-dist-tag.js +++ b/scripts/use-typescript-dist-tag.js @@ -44,7 +44,7 @@ async function main(distTag) { packageJson.devDependencies.typescript = version; packageJson.resolutions['**/dtslint/typescript'] = version; - // CircleCI seemingly times out if it has a newline diff at the end + // add newline for clean diff fs.writeFileSync(packageJsonPath, `${JSON.stringify(packageJson, null, 2)}${os.EOL}`); } From 62f9f636c91d2a5dc7db64df687e2be2321d67d4 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 8 Apr 2020 23:50:52 +0200 Subject: [PATCH 11/12] Revert "temp: Test with react-dist-tag: next in CI" This reverts commit a93c076127706eeae7264a6f579cbd75f162786d. --- .circleci/config.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7a6a09aea7ad24..f3ae30d7483584 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -210,8 +210,6 @@ workflows: - test_unit: requires: - checkout - # REVERT_ME_OR_JUST_KIDDING_IT_WILL_BE_FINE - react-dist-tag: next - test_static: requires: - checkout @@ -221,8 +219,6 @@ workflows: - test_browser: requires: - checkout - # REVERT_ME_OR_JUST_KIDDING_IT_WILL_BE_FINE - react-dist-tag: next - test_regressions: requires: - test_unit From 497ed0f107d1d6d2a0374d87d80ff8da61ffdfc1 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Thu, 9 Apr 2020 00:07:08 +0200 Subject: [PATCH 12/12] revert: fix: render counting --- .../src/StylesProvider/StylesProvider.test.js | 4 +--- packages/material-ui/src/GridList/GridList.test.js | 4 +--- packages/material-ui/src/Hidden/HiddenCss.test.js | 4 +--- .../material-ui/src/InputAdornment/InputAdornment.test.js | 4 +--- 4 files changed, 4 insertions(+), 12 deletions(-) diff --git a/packages/material-ui-styles/src/StylesProvider/StylesProvider.test.js b/packages/material-ui-styles/src/StylesProvider/StylesProvider.test.js index 74fb6ecf9e7d39..c3f963406a83dd 100644 --- a/packages/material-ui-styles/src/StylesProvider/StylesProvider.test.js +++ b/packages/material-ui-styles/src/StylesProvider/StylesProvider.test.js @@ -159,13 +159,11 @@ describe('StylesProvider', () => { , ); - assert.strictEqual(consoleErrorMock.callCount(), 2); + assert.strictEqual(consoleErrorMock.callCount(), 1); assert.include( consoleErrorMock.messages()[0], 'you cannot use the jss and injectFirst props at the same time', ); - // one error per render (twice rendered in StrictMode) - assert.strictEqual(consoleErrorMock.messages()[0], consoleErrorMock.messages()[1]); }); }); }); diff --git a/packages/material-ui/src/GridList/GridList.test.js b/packages/material-ui/src/GridList/GridList.test.js index 949b29645d2807..751610999f55db 100644 --- a/packages/material-ui/src/GridList/GridList.test.js +++ b/packages/material-ui/src/GridList/GridList.test.js @@ -189,13 +189,11 @@ describe('', () => { , ); - assert.strictEqual(consoleErrorMock.callCount(), 2); + assert.strictEqual(consoleErrorMock.callCount(), 1); assert.include( consoleErrorMock.messages()[0], "Material-UI: the GridList component doesn't accept a Fragment as a child.", ); - // one error per render (twice rendered in StrictMode) - assert.strictEqual(consoleErrorMock.messages()[0], consoleErrorMock.messages()[1]); }); }); }); diff --git a/packages/material-ui/src/Hidden/HiddenCss.test.js b/packages/material-ui/src/Hidden/HiddenCss.test.js index f39b8cd0a0b302..60bf25c025784f 100644 --- a/packages/material-ui/src/Hidden/HiddenCss.test.js +++ b/packages/material-ui/src/Hidden/HiddenCss.test.js @@ -160,13 +160,11 @@ describe('', () => { , ); - assert.strictEqual(consoleErrorMock.callCount(), 2); + assert.strictEqual(consoleErrorMock.callCount(), 1); assert.include( consoleErrorMock.messages()[0], 'Material-UI: unsupported props received by ``: xxlUp.', ); - // one error per render (twice rendered in StrictMode) - assert.strictEqual(consoleErrorMock.messages()[0], consoleErrorMock.messages()[1]); }); }); }); diff --git a/packages/material-ui/src/InputAdornment/InputAdornment.test.js b/packages/material-ui/src/InputAdornment/InputAdornment.test.js index 71b3fc7ed5cb95..01d505fe48747a 100644 --- a/packages/material-ui/src/InputAdornment/InputAdornment.test.js +++ b/packages/material-ui/src/InputAdornment/InputAdornment.test.js @@ -150,13 +150,11 @@ describe('', () => { /> , ); - expect(consoleErrorMock.callCount()).to.equal(2); + expect(consoleErrorMock.callCount()).to.equal(1); expect(consoleErrorMock.messages()[0]).to.equal( 'Material-UI: The `InputAdornment` variant infers the variant ' + 'prop you do not have to provide one.', ); - // one error per render (twice rendered in StrictMode) - expect(consoleErrorMock.messages()[0]).to.equal(consoleErrorMock.messages()[1]); }); }); });