diff --git a/packages/material-ui/src/DialogContentText/DialogContentText.test.js b/packages/material-ui/src/DialogContentText/DialogContentText.test.js index 6b9ecb1000ee06..4c19a3c7652ab9 100644 --- a/packages/material-ui/src/DialogContentText/DialogContentText.test.js +++ b/packages/material-ui/src/DialogContentText/DialogContentText.test.js @@ -1,25 +1,32 @@ import React from 'react'; import { assert } from 'chai'; -import { createShallow, getClasses } from '@material-ui/core/test-utils'; +import { createMount, createShallow, describeConformance, getClasses } from '../test-utils'; import DialogContentText from './DialogContentText'; +import Typography from '../Typography'; describe('', () => { + let mount; let shallow; let classes; before(() => { + mount = createMount(); shallow = createShallow({ dive: true }); classes = getClasses(); }); - describe('prop: className', () => { - it('should render with the user and root classes', () => { - const wrapper = shallow(); - assert.strictEqual(wrapper.props().className, 'woofDialogContentText'); - assert.strictEqual(wrapper.props().classes.root, classes.root); - }); + after(() => { + mount.cleanUp(); }); + describeConformance(foo, () => ({ + classes, + inheritComponent: Typography, + mount, + refInstanceof: window.HTMLParagraphElement, + skip: ['componentProp'], + })); + describe('prop: children', () => { it('should render children', () => { const children =

; diff --git a/packages/material-ui/src/test-utils/describeConformance.js b/packages/material-ui/src/test-utils/describeConformance.js index 0d1c71e596ac79..e4868dfa10207c 100644 --- a/packages/material-ui/src/test-utils/describeConformance.js +++ b/packages/material-ui/src/test-utils/describeConformance.js @@ -156,9 +156,9 @@ const fullSuite = { * @property {string} classes - `classes` of the component provided by `@material-ui/styles` * @property {string} inheritComponent - The element type that receives spread props. * @property {function} mount - Should be a return value from createMount - * @property {string[]?} only - If specified only run the tests listed + * @property {(keyof typeof fullSuite)[]?} only - If specified only run the tests listed * @property {boolean} refInstanceof - `ref` will be an instanceof this constructor. - * @property {string[]?} skip - Skip the specified tests + * @property {keyof typeof fullSuite[]?} skip - Skip the specified tests * @property {string?} testComponentPropWith - The host component that should be rendered instead. */ diff --git a/pages/api/dialog-content-text.md b/pages/api/dialog-content-text.md index 7ba6927b5043fe..56c3accc005f55 100644 --- a/pages/api/dialog-content-text.md +++ b/pages/api/dialog-content-text.md @@ -21,7 +21,7 @@ import DialogContentText from '@material-ui/core/DialogContentText'; | children | node | | The content of the component. | | classes | object | | Override or extend the styles applied to the component. See [CSS API](#css) below for more details. | -The component cannot hold a ref. +The `ref` is forwarded to the root element. Any other properties supplied will be spread to the root element ([Typography](/api/typography/)).