These are chat archives for airbnb/enzyme

7th
Mar 2016
Andrew McLagan
@andrewmclagan
Mar 07 2016 03:57
not really different
Anyone know if it is possible to select an element via an image src attribute?
e.g. `wrapper.find('[src="http://fake.com/image.jpg"]')
Leland Richardson
@lelandrichardson
Mar 07 2016 04:03
^ that should work, yes
also wrapper.find({ src: ‘…’ })
Chris Petty
@Chris-Petty
Mar 07 2016 20:30
Changed tune and went using mocha with expect for assertions, appears to be working sweet now. Also, I retract my wall of error issue with the example repo, that was my caused by mistake.
Leland Richardson
@lelandrichardson
Mar 07 2016 20:31
@Chris-Petty glad to hear you got it figured out!
Chris Petty
@Chris-Petty
Mar 07 2016 20:38

Still a novice :P New issue is on this line :
<Image source={require('image!house')} style={styles.image}/>

Throws: Error: Cannot find module 'image!house'

I've cheated and just commented out the line when I run the test and it went fine, but I imagine I need to mock it in some fashion?

Leland Richardson
@lelandrichardson
Mar 07 2016 20:39
this is more a react-native-mock issue
lelandrichardson/react-native-mock#11
some solutions are discussed there
Chris Petty
@Chris-Petty
Mar 07 2016 20:39
Awesome, thanks!
Leland Richardson
@lelandrichardson
Mar 07 2016 20:39
hopefully i will solve it in a more straight-forward way soon
Chris Petty
@Chris-Petty
Mar 07 2016 20:42
It's still blowing my mind that, thanks to the magic of the internet, I can communicate with the author of a repo who's timezone is about a full day out from my own
Chris Petty
@Chris-Petty
Mar 07 2016 21:20
Yea mockery dealt with it pretty painlessly.
pretty sure I need to refactor to make my test work now, or set up partial mocks like the monster I am.