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
First of all thanks for this great library! I am currently testing a React Native application and I found it hard to do so, as contains can't be differed to be more allowing.
My use case is that I have a component render a <Text> element which is set via prop, much like in your example test. Unfortunately my element needs a style prop, which I don't intend to share between my tests and application. Would it be possible to add a whitelist to the compare functions as additional argument? I would be glad to help and do a PR if this feature is chosen to be useful for anyone else.
Have a nice day!
The text was updated successfully, but these errors were encountered:
I also found this a bit counter intuitive my first time using enzyme. I currently use the approach below when I want to test the contents of an element independent of its props.
it('should render text inside the Text component', () => {
const text = 'Test Text';
const wrapper = shallow(
<Button text={text} />
);
expect(wrapper.find(Text).prop('children')).to.equal(text);
});
Hi there,
First of all thanks for this great library! I am currently testing a React Native application and I found it hard to do so, as
contains
can't be differed to be more allowing.My use case is that I have a component render a
<Text
> element which is set via prop, much like in your example test. Unfortunately my element needs a style prop, which I don't intend to share between my tests and application. Would it be possible to add a whitelist to the compare functions as additional argument? I would be glad to help and do a PR if this feature is chosen to be useful for anyone else.Have a nice day!
The text was updated successfully, but these errors were encountered: