Skip to content

Instantly share code, notes, and snippets.

@yangli-io
Created August 8, 2018 05:58
Show Gist options
  • Select an option

  • Save yangli-io/edf6caf265d02df9c725f52d6ff772e3 to your computer and use it in GitHub Desktop.

Select an option

Save yangli-io/edf6caf265d02df9c725f52d6ff772e3 to your computer and use it in GitHub Desktop.
it('should render a random id everytime', () => {
const lastId = component.find('input').prop('id');
const secondComponent = shallow(<Input />);
expect(secondComponent.find('input').prop('id')).to.equal(lastId);
});
it('should link the id between label and input', () => {
const labelHtmlFor = component.find('label').prop('htmlFor');
const inputId = component.find('input').prop('id');
expect(labelHtmlFor).to.equal(inputId);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment