mirror of
https://github.com/ant-design/ant-design.git
synced 2025-06-07 17:44:35 +08:00

* test: ✅ test menu and collapse motion
* chore: move openAnimation into collapse
* add test case
* rm extra openAnimation.tsx
* remove unused code
27 lines
948 B
JavaScript
27 lines
948 B
JavaScript
import mountTest from '../../../tests/shared/mountTest';
|
|
import rtlTest from '../../../tests/shared/rtlTest';
|
|
import Collapse from '..';
|
|
import openAnimation from '../openAnimation';
|
|
|
|
describe('Collapse', () => {
|
|
mountTest(Collapse);
|
|
rtlTest(Collapse);
|
|
});
|
|
|
|
describe('openAnimation', () => {
|
|
it('should support openAnimation', () => {
|
|
const done = jest.fn();
|
|
const domNode = document.createElement('div');
|
|
expect(typeof openAnimation.enter).toBe('function');
|
|
expect(typeof openAnimation.leave).toBe('function');
|
|
expect(typeof openAnimation.appear).toBe('function');
|
|
const appear = openAnimation.appear(domNode, done);
|
|
const enter = openAnimation.enter(domNode, done);
|
|
const leave = openAnimation.leave(domNode, done);
|
|
expect(typeof appear.stop).toBe('function');
|
|
expect(typeof enter.stop).toBe('function');
|
|
expect(typeof leave.stop).toBe('function');
|
|
expect(done).toHaveBeenCalled();
|
|
});
|
|
});
|