2022-08-08 17:01:25 +08:00
|
|
|
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));
|
|
|
|
|
2022-09-19 23:37:12 +08:00
|
|
|
expect(result.current).toEqual(
|
|
|
|
expect.objectContaining({
|
|
|
|
inkBar: true,
|
|
|
|
tabPane: true,
|
|
|
|
}),
|
|
|
|
);
|
2022-08-08 17:01:25 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
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',
|
|
|
|
}),
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|