These are chat archives for airbnb/enzyme

5th
Jul 2016
Peng Miao (mios)
@miaopeng
Jul 05 2016 02:12
@RebootJeff:
const wrapper = shallow(
      <MyComponent />
 );
wrapper.instance().myMethod();
Jeff Lee
@RebootJeff
Jul 05 2016 17:45
Ahh I overlooked .instance(). Thanks, @miaopeng !
marc314
@marc314
Jul 05 2016 17:47
hey anyone mind helping me out?
working with material-ui
which takes in some context values
const mountWithContext = node => mount(node, {options: {context: {muiTheme}}})

  const wrapper = mountWithContext(
      <LoginComponent
      updateEmail={updateEmail}
      updatePassword={updatePassword}
      isAuthenticating={isAuthenticating}
      login={login}
      style={style}
      statusText={statusText}
    />)


TypeError: Cannot read property 'prepareStyles' of undefined
im passing in the context arguments
but doesn't seem to be working
Jeff Lee
@RebootJeff
Jul 05 2016 17:57
Too many curly braces? Should options.context be set to muiTheme or {muiTheme}?
@marc314
marc314
@marc314
Jul 05 2016 17:57
hey one moment
didn't show that var
  const muiTheme = getMuiTheme()
reads as
muiTheme: muiTheme
es6
hmm