mirror of
https://github.com/ant-design/ant-design.git
synced 2025-08-06 07:56:28 +08:00
pref: spy on clearInterval for Upload & check actions for Card
This commit is contained in:
parent
337e0285ec
commit
2ee56a9c4a
@ -104,4 +104,13 @@ describe('Card', () => {
|
||||
const wrapper = mount(<Card noHovering={false}>xxx</Card>);
|
||||
expect(wrapper.find('.ant-card-hoverable').length).toBe(1);
|
||||
});
|
||||
|
||||
it('should not render when actions is number', () => {
|
||||
const wrapper = mount(
|
||||
<Card title="Card title" actions={11}>
|
||||
<p>Card content</p>
|
||||
</Card>,
|
||||
);
|
||||
expect(wrapper.find('.ant-card-actions').length).toBe(0);
|
||||
});
|
||||
});
|
||||
|
@ -377,7 +377,7 @@ describe('Upload', () => {
|
||||
<button type="button">upload</button>
|
||||
</Upload>,
|
||||
);
|
||||
const unmountSpy = jest.spyOn(wrapper.instance(), 'componentWillUnmount');
|
||||
const unmountSpy = jest.spyOn(global, 'clearInterval');
|
||||
wrapper.unmount();
|
||||
expect(unmountSpy).toHaveBeenCalled();
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user