Skip to content

Commit

Permalink
[SpeedDialAction] Fix className prop being ignored (#13161)
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon authored Oct 9, 2018
1 parent 8727c2d commit 0cb1cca
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class SpeedDialAction extends React.Component {
const {
ButtonProps,
classes,
className: classNameProp,
className,
delay,
icon,
id,
Expand Down Expand Up @@ -107,7 +107,7 @@ class SpeedDialAction extends React.Component {
<Button
variant="fab"
mini
className={classNames(classes.button, !open && classes.buttonClosed)}
className={classNames(className, classes.button, !open && classes.buttonClosed)}
style={{ transitionDelay: `${delay}ms` }}
tabIndex={-1}
role="menuitem"
Expand All @@ -131,6 +131,10 @@ SpeedDialAction.propTypes = {
* Useful to extend the style applied to components.
*/
classes: PropTypes.object.isRequired,
/**
* @ignore
*/
className: PropTypes.string,
/**
* Adds a transition delay, to allow a series of SpeedDialActions to be animated.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@ describe('<SpeedDialAction />', () => {
assert.strictEqual(buttonWrapper.hasClass(classes.buttonClosed), true);
});

it('passes the className to the Button', () => {
const className = 'my-speeddialaction';
const wrapper = shallow(<SpeedDialAction {...defaultProps} className={className} />);
const buttonWrapper = wrapper.childAt(0);
assert.strictEqual(buttonWrapper.hasClass(className), true);
});

describe('prop: onClick', () => {
it('should be called when a click is triggered', () => {
const handleClick = spy();
Expand Down

0 comments on commit 0cb1cca

Please sign in to comment.