File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed
packages/core/src/TransitionImage Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -73,3 +73,4 @@ import { ImageProps } from 'react-native';
7373| placeholderStyle | 占位符容器的附加样式(可选) | StyleProp<ViewStyle > | - |
7474| transition | 在图像加载时执行淡入淡出过渡 | boolean | - |
7575| transitionDuration | 图像加载时执行淡入淡出过渡时间 | boolean | - |
76+
Original file line number Diff line number Diff line change 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+ } ) ;
You can’t perform that action at this time.
0 commit comments