Skip to content

Commit 62a373a

Browse files
authored
Merge branch 'master' into dev
2 parents ac586fd + 8a648fa commit 62a373a

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

packages/core/src/TransitionImage/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,4 @@ import { ImageProps } from 'react-native';
7373
| placeholderStyle | 占位符容器的附加样式(可选) | StyleProp<ViewStyle> | - |
7474
| transition | 在图像加载时执行淡入淡出过渡 | boolean | - |
7575
| transitionDuration | 图像加载时执行淡入淡出过渡时间 | boolean | - |
76+
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/**
2+
* @format
3+
*/
4+
5+
import 'react-native';
6+
import React from 'react';
7+
import ExpandableSection from '../lib/ExpandableSection';
8+
import { View, Text } from 'react-native';
9+
import renderer from 'react-test-renderer';
10+
11+
it('ExpandableSection', () => {
12+
const component = renderer.create(
13+
<ExpandableSection sectionHeader={<h5>我是标题</h5>} expanded={true} top={true}>
14+
<View>
15+
<Text style={{ color: 'red' }}>展开的内容</Text>
16+
</View>
17+
</ExpandableSection>,
18+
);
19+
20+
expect(component.root.props.top).toBeTruthy();
21+
expect(component.root.props.expanded).toBeTruthy();
22+
expect(component.root.props.sectionHeader).toStrictEqual(<h5>我是标题</h5>);
23+
expect(component.root.props.children).toStrictEqual(
24+
<View>
25+
<Text style={{ color: 'red' }}>展开的内容</Text>
26+
</View>
27+
);
28+
});

0 commit comments

Comments
 (0)