ant-design/components/tabs/__tests__/animated.test.tsx
二货爱吃白萝卜 304b36a5bf
refactor: Replace Tabs motion (#36943)
* chore: bump rc-tabs

* refactor: use internal motion

* test: Update snapshot

* chore: clean up

* test: Update snapshot

* test: coverage

* test: resolve conflict
2022-08-08 17:01:25 +08:00

35 lines
857 B
TypeScript

import { renderHook } from '../../../tests/utils';
import useAnimateConfig from '../hooks/useAnimateConfig';
describe('Tabs.Animated', () => {
it('boolean: false', () => {
const { result } = renderHook(() => useAnimateConfig('test', false));
expect(result.current).toEqual({
inkBar: false,
tabPane: false,
});
});
it('boolean: true', () => {
const { result } = renderHook(() => useAnimateConfig('test', true));
expect(result.current).toEqual({
inkBar: true,
tabPane: false,
});
});
it('config', () => {
const { result } = renderHook(() => useAnimateConfig('test', { inkBar: false, tabPane: true }));
expect(result.current).toEqual({
inkBar: false,
tabPane: true,
tabPaneMotion: expect.objectContaining({
motionName: 'test-switch',
}),
});
});
});