Skip to content

Commit 1318789

Browse files
authored
[test] Migrate CssBaseline to react-testing-library (#22920)
1 parent 4084299 commit 1318789

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed
Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
11
import * as React from 'react';
22
import { expect } from 'chai';
3-
import { createMount } from 'test/utils';
3+
import { createClientRender } from 'test/utils';
44
import CssBaseline from './CssBaseline';
55

66
describe('<CssBaseline />', () => {
77
// StrictModeViolation: makeStyles will retain the styles in the head in strict mode
88
// which becomes an issue for global styles
9-
const mount = createMount({ strict: false });
9+
const render = createClientRender({ strict: false });
1010

1111
it('renders its children', () => {
12-
const wrapper = mount(
12+
const { container } = render(
1313
<CssBaseline>
1414
<div id="child" />
1515
</CssBaseline>,
1616
);
17-
expect(wrapper.find('#child').type()).to.equal('div');
17+
18+
const child = container.querySelector('#child');
19+
20+
expect(child.tagName).to.equal('DIV');
1821
});
1922
});

0 commit comments

Comments
 (0)