Browse Source
fix: Animated default set (#37642)
* fix: Animated default set
* test: Update test case
pull/37651/head
二货爱吃白萝卜
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
7 additions and
5 deletions
-
components/tabs/__tests__/animated.test.tsx
-
components/tabs/hooks/useAnimateConfig.ts
|
|
@ -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', () => { |
|
|
|
|
|
@ -26,7 +26,7 @@ export default function useAnimateConfig( |
|
|
|
} else if (animated === true) { |
|
|
|
mergedAnimated = { |
|
|
|
inkBar: true, |
|
|
|
tabPane: false, |
|
|
|
tabPane: true, |
|
|
|
}; |
|
|
|
} else { |
|
|
|
mergedAnimated = { |
|
|
|