From 13187899435875fd79792ccf29f96c55944b0d8b Mon Sep 17 00:00:00 2001 From: eladmotola <43670376+eladmotola@users.noreply.github.com> Date: Wed, 7 Oct 2020 15:54:25 +0300 Subject: [PATCH] [test] Migrate CssBaseline to react-testing-library (#22920) --- .../material-ui/src/CssBaseline/CssBaseline.test.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/material-ui/src/CssBaseline/CssBaseline.test.js b/packages/material-ui/src/CssBaseline/CssBaseline.test.js index 5913465e772f0c..b57b974c806b38 100644 --- a/packages/material-ui/src/CssBaseline/CssBaseline.test.js +++ b/packages/material-ui/src/CssBaseline/CssBaseline.test.js @@ -1,19 +1,22 @@ import * as React from 'react'; import { expect } from 'chai'; -import { createMount } from 'test/utils'; +import { createClientRender } from 'test/utils'; import CssBaseline from './CssBaseline'; describe('', () => { // StrictModeViolation: makeStyles will retain the styles in the head in strict mode // which becomes an issue for global styles - const mount = createMount({ strict: false }); + const render = createClientRender({ strict: false }); it('renders its children', () => { - const wrapper = mount( + const { container } = render(
, ); - expect(wrapper.find('#child').type()).to.equal('div'); + + const child = container.querySelector('#child'); + + expect(child.tagName).to.equal('DIV'); }); });