You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 30, 2020. It is now read-only.
I am using React Native 0.61.5 with native-testing-library version 5.0.1 and Node 10.14. I recently upgraded my React Native project from 0.59 to 0.61. As a part of that upgrade, I also upgraded my Testing Library version from 4.0.7 to 5.0.1. It appears that the *DisplayValue queries cannot find text elements with empty values.
I believe the issue is the "if" block on Line 25 of this file (I have not confirmed yet, but I will spend some time on it):
importReactfrom'react';importmountfrom'core/test/support/mount';// In my project, this is basically just the render function from native-testing-libraryimport{TextInput}from'react-native';functionTextElement(){return<TextInputvalue={''}/>;}functionmountComponent(){returnmount(<TextElement/>);}it('finds the empty text element',()=>{const{ getByDisplayValue }=mountComponent();getByDisplayValue('');});
I'll see if I can fix this locally. I'll try to submit a PR with a potential fix, but I am not sure why the code in matches.js was added between 4.0.7 and 5.0.1, and I don't want to introduce another potential bug. Any insight or guidance on how to test empty text fields would be great.
The text was updated successfully, but these errors were encountered:
Hello,
I am using React Native 0.61.5 with native-testing-library version 5.0.1 and Node 10.14. I recently upgraded my React Native project from 0.59 to 0.61. As a part of that upgrade, I also upgraded my Testing Library version from 4.0.7 to 5.0.1. It appears that the *DisplayValue queries cannot find text elements with empty values.
I believe the issue is the "if" block on Line 25 of this file (I have not confirmed yet, but I will spend some time on it):
https://github.com/testing-library/native-testing-library/blob/master/src/lib/matches.js
Relevant code or config:
Here is an example failing test.
For reference, here is the debug output:
I'll see if I can fix this locally. I'll try to submit a PR with a potential fix, but I am not sure why the code in matches.js was added between 4.0.7 and 5.0.1, and I don't want to introduce another potential bug. Any insight or guidance on how to test empty text fields would be great.
The text was updated successfully, but these errors were encountered: