File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -22,15 +22,16 @@ This library is a replacement for [Enzyme](http://airbnb.io/enzyme/).
2222import { render } from ' react-native-testing-library' ;
2323import { QuestionsBoard } from ' ../QuestionsBoard' ;
2424
25- function setAnswer (getAllByName , index , answer ) {
26- getAllByName ( ' Question ' )[index] .props .onChangeText (answer);
25+ function setAnswer (question , answer ) {
26+ question .props .onChangeText (answer);
2727}
2828
2929test (' should verify two questions' , () => {
3030 const { getAllByName , getByText } = render (< QuestionsBoard {... props} / > );
31+ const allQuestions = getAllByName (' Question' );
3132
32- setAnswer (getAllByName, 0 , ' a1' );
33- setAnswer (getAllByName, 1 , ' a2' );
33+ setAnswer (allQuestions[ 0 ] , ' a1' );
34+ setAnswer (allQuestions[ 1 ] , ' a2' );
3435
3536 getByText (' submit' ).props .onPress ();
3637
You can’t perform that action at this time.
0 commit comments