Skip to content

Commit df0fd00

Browse files
committed
[TouchRipple] Test conformance
1 parent d5d458a commit df0fd00

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed

packages/material-ui/src/ButtonBase/TouchRipple.test.js

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { assert } from 'chai';
44
import {
55
createShallow,
66
createMount,
7-
findOutermostIntrinsic,
7+
describeConformance,
88
getClasses,
99
unwrap,
1010
} from '@material-ui/core/test-utils';
@@ -29,17 +29,13 @@ describe('<TouchRipple />', () => {
2929
mount.cleanUp();
3030
});
3131

32-
it('should render a span', () => {
33-
const wrapper = mount(<TouchRipple />);
34-
const root = findOutermostIntrinsic(wrapper);
35-
assert.strictEqual(root.type(), 'span');
36-
assert.strictEqual(root.hasClass(classes.root), true);
37-
});
38-
39-
it('should render the custom className', () => {
40-
const wrapper = mount(<TouchRipple className="test-class-name" />);
41-
assert.strictEqual(findOutermostIntrinsic(wrapper).hasClass('test-class-name'), true);
42-
});
32+
describeConformance(<TouchRipple />, () => ({
33+
classes,
34+
inheritComponent: 'span',
35+
mount,
36+
refInstanceof: React.Component,
37+
testComponentPropWith: false,
38+
}));
4339

4440
describe('prop: center', () => {
4541
it('should should compute the right ripple dimensions', () => {

pages/api/touch-ripple.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import TouchRipple from '@material-ui/core/ButtonBase/TouchRipple';
2121
| <span class="prop-name">center</span> | <span class="prop-type">bool</span> | <span class="prop-default">false</span> | If `true`, the ripple starts at the center of the component rather than at the point of interaction. |
2222
| <span class="prop-name">classes</span> | <span class="prop-type">object</span> | | Override or extend the styles applied to the component. See [CSS API](#css) below for more details. |
2323

24-
The component cannot hold a ref.
24+
The `ref` is attached to a component class.
2525

2626
Any other properties supplied will be spread to the root element (native element).
2727

0 commit comments

Comments
 (0)