From 497ed0f107d1d6d2a0374d87d80ff8da61ffdfc1 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Thu, 9 Apr 2020 00:07:08 +0200 Subject: [PATCH] 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]); }); }); });