Last active
November 6, 2018 21:50
-
-
Save kvendrik/f7bf26fe27ce94dde14e786ea1496076 to your computer and use it in GitHub Desktop.
TextField example - test setup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as React from 'react'; | |
import {mount} from 'enzyme'; | |
import {noop} from '@shopify/javascript-utilities/other'; | |
import TextField from '../TextField'; | |
describe('<TextField />', () => { | |
const mockProps = { | |
onChange: noop, | |
}; | |
describe('type', () => { | |
it('passes the specified type into the input', () => { | |
const type = 'email'; | |
const textField = mount(<TextField {...mockProps} type={type} />); | |
expect(textField.find('input').prop('type')).toBe(type); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment