ant-design/components/tabs/__tests__/animated.test.tsx
二货爱吃白萝卜 f7782a05a9
fix: Animated default set (#37642)
* fix: Animated default set

* test: Update test case
2022-09-19 23:37:12 +08:00

37 lines
900 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(
expect.objectContaining({
inkBar: true,
tabPane: true,
}),
);
});
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',
}),
});
});
});