From 19eb67814353e4d2434d92a57cb9c71b3ea2e0c1 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Sun, 3 Nov 2019 17:14:16 +0100 Subject: [PATCH] [test] Fix tests polluting DOM --- .../material-ui-lab/src/TreeItem/TreeItem.test.js | 11 ++++++++--- .../material-ui-lab/src/TreeView/TreeView.test.js | 10 ++++++++-- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/packages/material-ui-lab/src/TreeItem/TreeItem.test.js b/packages/material-ui-lab/src/TreeItem/TreeItem.test.js index afbd340354de90..7cd21eaa0e4fd7 100644 --- a/packages/material-ui-lab/src/TreeItem/TreeItem.test.js +++ b/packages/material-ui-lab/src/TreeItem/TreeItem.test.js @@ -8,10 +8,15 @@ import TreeItem from './TreeItem'; import TreeView from '../TreeView'; describe('', () => { - // StrictModeViolation: uses Collapse + let classes; + let mount; const render = createClientRender({ strict: false }); - const mount = createMount({ strict: false }); - const classes = getClasses(); + + before(() => { + // StrictModeViolation: uses Collapse + mount = createMount({ strict: false }); + classes = getClasses(); + }); describeConformance(, () => ({ classes, diff --git a/packages/material-ui-lab/src/TreeView/TreeView.test.js b/packages/material-ui-lab/src/TreeView/TreeView.test.js index e298f9c6b74735..a04f140fe6ab17 100644 --- a/packages/material-ui-lab/src/TreeView/TreeView.test.js +++ b/packages/material-ui-lab/src/TreeView/TreeView.test.js @@ -8,9 +8,15 @@ import TreeView from './TreeView'; import TreeItem from '../TreeItem'; describe('', () => { + let classes; + let mount; + // StrictModeViolation: test uses TreeItem const render = createClientRender({ strict: false }); - const mount = createMount({ strict: false }); - const classes = getClasses(); + + before(() => { + mount = createMount({ strict: true }); + classes = getClasses(); + }); describeConformance(, () => ({ classes,