강의

멘토링

커뮤니티

Inflearn Community Q&A

concotree8563's profile image
concotree8563

asked

Developing React Native apps using the TDD development methodology

AddToDo Component

TextInput을 찾지 못합니다.

Written on

·

359

1

텍스트 인풋을 찾지 못하고 실패합니다. 이유를 잘 모르겠습니다.

javascriptreactreact-nativetdd

Answer 3

0

enzyme에서 제공하는 debug 함수로 확인 해본결과 

 <View>

   <Component allowFontScaling={true}rejectResponderTermination={true} underlineColorAndroid="transparent" />

  <Button title="A" />

</View> 값을 리턴 받습니다.

테스트 코드를 작성하는 곳에서 

import { TextInput } from 'react-native';

expect(wrapper.find(TextInput)).toHaveLength(1);

이러한 형태로 테스트를 진행하시면 통과가 됩니다.

0

저도 TextInput 테스트만 실패하네요.. 어떻게 해결하셨나요?

0

concotree8563님의 프로필 이미지
concotree8563
Questioner

TextInput을 import 해서 TextInput component를 find하니까 되네요... 이유를 모르겠습니다.. ㅠㅠ

concotree8563's profile image
concotree8563

asked

Ask a question