eduardomoroni/mtgx

View on GitHub
__tests__/unit/src/modules/form/components/inputLabel.test.js

Summary

Maintainability
A
0 mins
Test Coverage
// @flow

import React from 'react'
import { shallow } from 'enzyme'
import { InputLabel } from '../../../../../../src/modules/form/components'

const props = {
  label: 'label',
  onPress: jest.fn()
}

describe('<InputLabel />', () => {
  const wrapper = shallow(<InputLabel {...props} />)

  it('should have a snapshot', () => {
    expect(wrapper).toMatchSnapshot()
  })

  it('should activate callback on press', () => {
    wrapper.simulate('press')
    expect(props.onPress).toHaveBeenCalled()
  })
})