Advertisement
Guest User

Untitled

a guest
Jun 27th, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. import test from 'ava'
  2. import React from 'react'
  3. import Button from '../Button'
  4. import { shallow } from 'enzyme'
  5.  
  6. test('component structure', t => {
  7. const wrapper = shallow(<Button onPress={() => {}} text='hi' />)
  8.  
  9. t.is(wrapper.name(), 'TouchableOpacity') // root component
  10. t.is(wrapper.children().length, 1) // has 1 child
  11. t.is(wrapper.children().first().name(), 'Text')
  12. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement