Browse Source

fix: Animated default set (#37642)

* fix: Animated default set

* test: Update test case
pull/37651/head
二货爱吃白萝卜 2 years ago
committed by GitHub
parent
commit
f7782a05a9
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      components/tabs/__tests__/animated.test.tsx
  2. 2
      components/tabs/hooks/useAnimateConfig.ts

10
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', () => {

2
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 = {

Loading…
Cancel
Save