From f7782a05a920a6b9646e21efb5e443f05c5ac00b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8C=E8=B4=A7=E7=88=B1=E5=90=83=E7=99=BD=E8=90=9D?= =?UTF-8?q?=E5=8D=9C?= Date: Mon, 19 Sep 2022 23:37:12 +0800 Subject: [PATCH] fix: Animated default set (#37642) * fix: Animated default set * test: Update test case --- components/tabs/__tests__/animated.test.tsx | 10 ++++++---- components/tabs/hooks/useAnimateConfig.ts | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/components/tabs/__tests__/animated.test.tsx b/components/tabs/__tests__/animated.test.tsx index 30c51fbc8f..f0be8e2d08 100644 --- a/components/tabs/__tests__/animated.test.tsx +++ b/components/tabs/__tests__/animated.test.tsx @@ -14,10 +14,12 @@ describe('Tabs.Animated', () => { it('boolean: true', () => { const { result } = renderHook(() => useAnimateConfig('test', true)); - expect(result.current).toEqual({ - inkBar: true, - tabPane: false, - }); + expect(result.current).toEqual( + expect.objectContaining({ + inkBar: true, + tabPane: true, + }), + ); }); it('config', () => { diff --git a/components/tabs/hooks/useAnimateConfig.ts b/components/tabs/hooks/useAnimateConfig.ts index 31695d9f3a..7af05e990b 100644 --- a/components/tabs/hooks/useAnimateConfig.ts +++ b/components/tabs/hooks/useAnimateConfig.ts @@ -26,7 +26,7 @@ export default function useAnimateConfig( } else if (animated === true) { mergedAnimated = { inkBar: true, - tabPane: false, + tabPane: true, }; } else { mergedAnimated = {