File tree Expand file tree Collapse file tree 2 files changed +40
-0
lines changed Expand file tree Collapse file tree 2 files changed +40
-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 Badge from '../lib/Badge' ;
8+ // Note: test renderer must be required after react-native.
9+ import renderer from 'react-test-renderer' ;
10+
11+ it ( 'Badge' , ( ) => {
12+ const component = renderer . create (
13+ < Badge text = "标记" color = "red" rounded = { 12 } />
14+ ) ;
15+ expect ( component . root . props . type ) . toBeTruthy ( ) ;
16+ expect ( component . root . props . color ) . toBe ( 'red' ) ;
17+ expect ( component . root . props . text ) . toBe ( '标记' ) ;
18+ expect ( component . root . props . rounded ) . toBe ( 12 ) ;
19+ } ) ;
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 Empty from '../lib/Empty' ;
8+ // Note: test renderer must be required after react-native.
9+ import renderer from 'react-test-renderer' ;
10+
11+ it ( 'Empty' , ( ) => {
12+ const component = renderer . create (
13+ < Empty label = "冇得数据咯" size = { 120 } labelStyle = { { color : 'red' } } > 冇得数据咯</ Empty >
14+ ) ;
15+ expect ( component . root . props . label ) . toBe ( '冇得数据咯' ) ;
16+ expect ( component . root . props . size ) . toBe ( 120 ) ;
17+ expect ( component . root . props . labelStyle ) . toBeTruthy ( ) ;
18+ expect ( component . root . props . xml ) . toBeTruthy ( ) ;
19+ expect ( component . root . props . children ) . toBe ( '冇得数据咯' ) ;
20+
21+ } ) ;
You can’t perform that action at this time.
0 commit comments