Skip to content

Instantly share code, notes, and snippets.

@grant-garland
grant-garland / enzyme_render_diffs.md
Created September 12, 2018 18:41 — forked from fokusferit/enzyme_render_diffs.md
Difference between Shallow, Mount and render of Enzyme

Shallow

Real unit test (isolation, no children render)

Simple shallow

Calls:

  • constructor
  • render
@grant-garland
grant-garland / gist:7ac0bf30c30069d0f74846e55c34e4b1
Created January 19, 2018 18:35
React button render function
render: function() {
const value = this.props.value;
const buttons = this.props.buttons.map((button, i) => {
return <button title={button.title}
type="button"
id={"" + i}
ref={"button" + i}
key={"" + i}
className={css(
styles.button.buttonStyle,