File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -70,6 +70,24 @@ describe('helpers test', () => {
7070 expect ( defaultTouchableProps ) . to . be . an ( 'object' ) ;
7171 } ) ;
7272
73+ it ( 'should create TouchableHighlight for web' , ( ) => {
74+ Platform . select . mockImplementationOnce ( o => {
75+ return o . web ;
76+ } ) ;
77+ const { Touchable, defaultTouchableProps } = makeTouchable ( ) ;
78+ expect ( Touchable ) . to . be . equal ( TouchableHighlight ) ;
79+ expect ( defaultTouchableProps ) . to . be . an ( 'object' ) ;
80+ } ) ;
81+
82+ it ( 'should create TouchableHighlight for windows' , ( ) => {
83+ Platform . select . mockImplementationOnce ( o => {
84+ return o . windows ;
85+ } ) ;
86+ const { Touchable, defaultTouchableProps } = makeTouchable ( ) ;
87+ expect ( Touchable ) . to . be . equal ( TouchableHighlight ) ;
88+ expect ( defaultTouchableProps ) . to . be . an ( 'object' ) ;
89+ } ) ;
90+
7391 it ( 'should return passed component' , ( ) => {
7492 const MyTouchable = ( ) => null ;
7593 const { Touchable, defaultTouchableProps } = makeTouchable ( MyTouchable ) ;
Original file line number Diff line number Diff line change @@ -27,8 +27,9 @@ export const makeName = (function() {
2727 */
2828export function makeTouchable ( TouchableComponent ) {
2929 const Touchable = TouchableComponent || Platform . select ( {
30- ios : TouchableHighlight ,
3130 android : TouchableNativeFeedback ,
31+ ios : TouchableHighlight ,
32+ web : TouchableHighlight ,
3233 windows :TouchableHighlight ,
3334 } ) ;
3435 let defaultTouchableProps = { } ;
You can’t perform that action at this time.
0 commit comments