sc-react-ions
Version:
An open source set of React components that implement Ambassador's Design and UX patterns.
18 lines (13 loc) • 547 B
JavaScript
import React from 'react'
import ValidatedField from '../src/components/FormGroup/ValidatedField'
import Input from '../src/components/Input'
describe('ValidatedField', () => {
let wrapper
const ValidatedInput = ValidatedField(Input)
it('should shallow render itself', () => {
wrapper = shallow(<ValidatedInput error='Error here.' />)
expect(wrapper.hasClass('validated-field has-error')).to.be.true
expect(wrapper.find(Input)).to.be.length(1)
expect(wrapper.childAt(1).hasClass('has-error__message')).to.be.true
})
})