Skip to content

Commit

Permalink
[TouchRipple] Test conformance
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon committed Apr 3, 2019
1 parent d5d458a commit df0fd00
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
20 changes: 8 additions & 12 deletions packages/material-ui/src/ButtonBase/TouchRipple.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { assert } from 'chai';
import {
createShallow,
createMount,
findOutermostIntrinsic,
describeConformance,
getClasses,
unwrap,
} from '@material-ui/core/test-utils';
Expand All @@ -29,17 +29,13 @@ describe('<TouchRipple />', () => {
mount.cleanUp();
});

it('should render a span', () => {
const wrapper = mount(<TouchRipple />);
const root = findOutermostIntrinsic(wrapper);
assert.strictEqual(root.type(), 'span');
assert.strictEqual(root.hasClass(classes.root), true);
});

it('should render the custom className', () => {
const wrapper = mount(<TouchRipple className="test-class-name" />);
assert.strictEqual(findOutermostIntrinsic(wrapper).hasClass('test-class-name'), true);
});
describeConformance(<TouchRipple />, () => ({
classes,
inheritComponent: 'span',
mount,
refInstanceof: React.Component,
testComponentPropWith: false,
}));

describe('prop: center', () => {
it('should should compute the right ripple dimensions', () => {
Expand Down
2 changes: 1 addition & 1 deletion pages/api/touch-ripple.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import TouchRipple from '@material-ui/core/ButtonBase/TouchRipple';
| <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. |
| <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. |

The component cannot hold a ref.
The `ref` is attached to a component class.

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

Expand Down

0 comments on commit df0fd00

Please sign in to comment.