Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import test from 'ava'
- import React from 'react'
- import Button from '../Button'
- import { shallow } from 'enzyme'
- test('component structure', t => {
- const wrapper = shallow(<Button onPress={() => {}} text='hi' />)
- t.is(wrapper.name(), 'TouchableOpacity') // root component
- t.is(wrapper.children().length, 1) // has 1 child
- t.is(wrapper.children().first().name(), 'Text')
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement