File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Expand file tree Collapse file tree 1 file changed +34
-0
lines changed 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 Result from '../lib/Result' ;
8+ import Icon from '../lib/Icon' ;
9+ import Del from '../lib/Typography/S' ;
10+ import { Text } from 'react-native' ;
11+ // Note: test renderer must be required after react-native.
12+ import renderer from 'react-test-renderer' ;
13+
14+ it ( 'Result' , ( ) => {
15+ // const component = TestRenderer.create(<Radio value="1">Radio</Radio>);
16+ const component = renderer . create (
17+ < Result
18+ img = { < Icon name = "pay-circle-o" size = { 60 } fill = "#008EF0" /> }
19+ title = "支付成功"
20+ message = {
21+ < Text >
22+ 998.00元 < Del > 1098元</ Del >
23+ </ Text >
24+ }
25+ /> ,
26+ ) ;
27+ expect ( component . root . props . img ) . toStrictEqual ( < Icon name = "pay-circle-o" size = { 60 } fill = "#008EF0" /> ) ;
28+ expect ( component . root . props . title ) . toBe ( '支付成功' ) ;
29+ expect ( component . root . props . message ) . toStrictEqual (
30+ < Text >
31+ 998.00元 < Del > 1098元</ Del >
32+ </ Text > ,
33+ ) ;
34+ } ) ;
You can’t perform that action at this time.
0 commit comments