Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SpeedDialAction] Fix className prop being ignored #13161

Merged
merged 1 commit into from
Oct 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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