Skip to content

Instantly share code, notes, and snippets.

@casesandberg
Last active September 25, 2017 23:37
Show Gist options
  • Save casesandberg/f6a5c67457427306cbb85985442b8929 to your computer and use it in GitHub Desktop.
Save casesandberg/f6a5c67457427306cbb85985442b8929 to your computer and use it in GitHub Desktop.
React Color Edible Input Focus Test
import { mount } from 'enzyme'
// Should Focus
const input = mount(<EdibleInput focusHexInputOnMount />);
assert(input.find('input').node === document.activeElement);
// Shouldn't Focus
const input = mount(<EdibleInput focusHexInputOnMoun={ false } />);
assert(input.find('input').node !== document.activeElement);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment