Skip to content

Commit

Permalink
[test] Migrate CssBaseline to react-testing-library (#22920)
Browse files Browse the repository at this point in the history
  • Loading branch information
eladmotola committed Oct 7, 2020
1 parent 4084299 commit 1318789
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions packages/material-ui/src/CssBaseline/CssBaseline.test.js
Original file line number Diff line number Diff line change
@@ -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('<CssBaseline />', () => {
// 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(
<CssBaseline>
<div id="child" />
</CssBaseline>,
);
expect(wrapper.find('#child').type()).to.equal('div');

const child = container.querySelector('#child');

expect(child.tagName).to.equal('DIV');
});
});

0 comments on commit 1318789

Please sign in to comment.