mirror of
https://github.com/ant-design/ant-design.git
synced 2025-07-31 12:18:42 +08:00
Fix wave render error in jest, close #11868
This commit is contained in:
parent
68959b9a4f
commit
62bacb09bf
@ -50,7 +50,9 @@ export default class Wave extends React.Component<{insertExtraNode?: boolean}> {
|
||||
}
|
||||
|
||||
bindAnimationEvent = (node: HTMLElement) => {
|
||||
if (node.getAttribute('disabled') ||
|
||||
if (!node ||
|
||||
!node.getAttribute ||
|
||||
node.getAttribute('disabled') ||
|
||||
node.className.indexOf('disabled') >= 0) {
|
||||
return;
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
import React, { Component } from 'react';
|
||||
import { render, mount } from 'enzyme';
|
||||
import renderer from 'react-test-renderer';
|
||||
import Button from '..';
|
||||
import Icon from '../../icon';
|
||||
|
||||
@ -11,6 +12,13 @@ describe('Button', () => {
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it('mount correctly', () => {
|
||||
const wrapper = mount(
|
||||
<Button>Follow</Button>
|
||||
);
|
||||
expect(() => renderer.create(wrapper).toJSON()).not.toThrow();
|
||||
});
|
||||
|
||||
it('renders Chinese characters correctly', () => {
|
||||
const wrapper = render(
|
||||
<Button>按钮</Button>
|
||||
|
Loading…
Reference in New Issue
Block a user