This repository was archived by the owner on Jul 30, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +27
-16
lines changed Expand file tree Collapse file tree 3 files changed +27
-16
lines changed Original file line number Diff line number Diff line change 5656 "metro-react-native-babel-preset" : " ^0.52.0" ,
5757 "prettier" : " ^1.16.4" ,
5858 "pretty-quick" : " ^1.10.0" ,
59- "react" : " ^ 16.8.5 " ,
59+ "react" : " 16.8.3 " ,
6060 "react-hooks-testing-library" : " ^0.5.0" ,
6161 "react-intl" : " ^2.8.0" ,
6262 "react-intl-native" : " ^2.1.2" ,
63- "react-native" : " ^0.59.0 " ,
63+ "react-native" : " ^0.59.5 " ,
6464 "react-native-gesture-handler" : " ^1.1.0" ,
6565 "react-navigation" : " ^3.5.1" ,
66- "react-redux" : " 6 .0.1 " ,
67- "redux" : " ^4.0.0 " ,
66+ "react-redux" : " ^7 .0.3 " ,
67+ "redux" : " ^4.0.1 " ,
6868 "semantic-release" : " ^15.13.3"
6969 },
7070 "peerDependencies" : {
Original file line number Diff line number Diff line change 1+ import { queryAllByProp } from '../lib' ;
2+ import { render } from '../index' ;
3+ import { Text , View } from 'react-native' ;
4+ import React from 'react' ;
5+
6+ // This is to ensure custom queries can be passed to render. In most cases, you
7+ // wouldn't/shouldn't need to do this, but we do allow it so we'll test to
8+ // make sure that it works for those who use it.
9+ test ( 'returns the queries passed as options bound to the container' , ( ) => {
10+ const queryAllBySelectionColor = queryAllByProp . bind ( null , 'selectionColor' ) ;
11+ const queries = { queryAllBySelectionColor } ;
12+
13+ const { queryAllBySelectionColor : queryAllByImplementationDetail } = render (
14+ < View >
15+ < Text selectionColor = "blue" > hello world</ Text >
16+ </ View > ,
17+ { queries } ,
18+ ) ;
19+
20+ expect ( queryAllByImplementationDetail ( 'blue' ) ) . toHaveLength ( 1 ) ;
21+ } ) ;
Original file line number Diff line number Diff line change 11import React from 'react' ;
2- import { View } from 'react-native' ;
3- import { render } from '../' ;
2+ import { Text , View } from 'react-native' ;
3+ import { queryAllByProp , render } from '../' ;
44
55test ( 'renders View' , ( ) => {
66 const { container } = render ( < View /> ) ;
@@ -30,13 +30,3 @@ test('renders options.wrapper around node', () => {
3030</View>
3131` ) ;
3232} ) ;
33-
34- test ( 'returns the queries passed as options bound to the container' , ( ) => {
35- const _getQueryPassedAsOption = { bind : jest . fn ( ( ) => _getQueryPassedAsOption ) } ;
36- const queries = { getQueryPassedAsOption : _getQueryPassedAsOption } ;
37-
38- const { container, getQueryPassedAsOption } = render ( < View /> , { queries } ) ;
39-
40- expect ( queries . getQueryPassedAsOption . bind ) . toHaveBeenCalledWith ( null , container ) ;
41- expect ( getQueryPassedAsOption ) . toEqual ( _getQueryPassedAsOption ) ;
42- } ) ;
You can’t perform that action at this time.
0 commit comments