Skip to content

Commit

Permalink
fix: regression from #135
Browse files Browse the repository at this point in the history
  • Loading branch information
picodoth committed Apr 28, 2018
1 parent a3d5aac commit c7227ff
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/SubMenu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ export class SubMenu extends React.Component {
// show appear transition if it's not inline mode
const transitionAppear = haveRendered || !baseProps.visible || !baseProps.mode === 'inline';

baseProps.className += ` ${baseProps.prefixCls}-sub`;
baseProps.className = ` ${baseProps.prefixCls}-sub`;
const animProps = {};

if (baseProps.openTransitionName) {
Expand Down
9 changes: 9 additions & 0 deletions src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,13 @@ export const menuAllProps = [
'isSelected',
'store',
'activeKey',

// the following keys found need to be removed from test regression
'attribute',
'value',
'onClick',
'popupClassName',
'inlineCollapsed',
'menu',
'theme',
];
6 changes: 1 addition & 5 deletions tests/MenuItem.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ describe('MenuItem', () => {

describe('rest props', () => {
it('can render all props to sub component', () => {
const onClick = jest.fn();
const onClick = jest.fn(() => {console.log('hello')});
const restProps = {
onClick,
'data-whatever': 'whatever',
Expand All @@ -106,10 +106,6 @@ describe('MenuItem', () => {
expect(wrapper.render()).toMatchSnapshot();
wrapper.find('MenuItem').at(0).simulate('click');
expect(onClick).toHaveBeenCalledTimes(1);
wrapper.find('SubMenu').at(0).simulate('click');
expect(onClick).toHaveBeenCalledTimes(2);
wrapper.find('MenuItemGroup').at(0).simulate('click');
expect(onClick).toHaveBeenCalledTimes(3);
});
});
});

0 comments on commit c7227ff

Please sign in to comment.