mirror of
https://github.com/ant-design/ant-design.git
synced 2025-08-05 07:26:56 +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) => {
|
bindAnimationEvent = (node: HTMLElement) => {
|
||||||
if (node.getAttribute('disabled') ||
|
if (!node ||
|
||||||
|
!node.getAttribute ||
|
||||||
|
node.getAttribute('disabled') ||
|
||||||
node.className.indexOf('disabled') >= 0) {
|
node.className.indexOf('disabled') >= 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import { render, mount } from 'enzyme';
|
import { render, mount } from 'enzyme';
|
||||||
|
import renderer from 'react-test-renderer';
|
||||||
import Button from '..';
|
import Button from '..';
|
||||||
import Icon from '../../icon';
|
import Icon from '../../icon';
|
||||||
|
|
||||||
@ -11,6 +12,13 @@ describe('Button', () => {
|
|||||||
expect(wrapper).toMatchSnapshot();
|
expect(wrapper).toMatchSnapshot();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('mount correctly', () => {
|
||||||
|
const wrapper = mount(
|
||||||
|
<Button>Follow</Button>
|
||||||
|
);
|
||||||
|
expect(() => renderer.create(wrapper).toJSON()).not.toThrow();
|
||||||
|
});
|
||||||
|
|
||||||
it('renders Chinese characters correctly', () => {
|
it('renders Chinese characters correctly', () => {
|
||||||
const wrapper = render(
|
const wrapper = render(
|
||||||
<Button>按钮</Button>
|
<Button>按钮</Button>
|
||||||
|
Loading…
Reference in New Issue
Block a user