Last active
January 16, 2019 01:01
-
-
Save Lukeghenco/77de15847be707d40bcd67db4552adc2 to your computer and use it in GitHub Desktop.
Enzyme/React-Testing-Libary Step: 8
This file contains 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
it('will use the name prop to connect label to textarea tag if id prop is not present', () => { | |
const { getByLabelText, getByText } = render(<TextAreaInput {…defaultProps} id={null} />) | |
const label = getByText(defaultProps.labelText) | |
const textareaInput = getByLabelText(defaultProps.labelText) | |
expect(label.htmlFor).toEqual(defaultProps.name) | |
expect(textareaInput.id).toEqual(defaultProps.name) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment