testing components with enzyme
See original GitHub issueHi guys, Thanks for great work in NativeBase. My project looks like this: react-native 0.51.0 native-base 2.3.5 emzyme 3.3.0 jest 20.0.4
I’m having difficulty using enzyme to render my components. What I’m trying to achieve is to render a component, which has included a number of NativeBase components. I’m encountering several warnings for instance:
Warning: <Text /> is using incorrect casing. Use PascalCase for React components, or lowercase for HTML elements.
and
Warning: React does not recognize the
allowFontScalingprop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase
allowfontscalinginstead. If you accidentally passed it from a parent component, remove it from the DOM element. in Text in Text (at Text.js:30) in Text in Styled(Text)
My guess is that enzyme was not able to determine correct environment and thinks we are in React. any hints what should I do to fix this?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:8 (2 by maintainers)
Top GitHub Comments
Having the same issue. Apparently the tests run good, but the warning does appear.
Following solved the problem for me