<p dir="auto">When attempting to detect a TextField in a test using containsMatchingElement, the detection failed.  I narrowed it down to some issue with boolean properties.</p>
<p dir="auto">Version: 0.19.4</p>


<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://github.com/mui-org/material-ui/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h2 dir="auto">Expected Behavior</h2>

<h2 dir="auto">Current Behavior</h2>

<h2 dir="auto">Steps to Reproduce (for bugs)</h2>

<p dir="auto">Here's the example code that is failing.  I would expect both tests to pass, but only the first one does.  <del>I will move this code to codesandbox.io and add link</del> Looks like codesandbox doesn't support running tests.</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import React from 'react'
import { assert, expect } from 'chai'
import { shallow } from 'enzyme'

import TextField from 'material-ui/TextField'

// Successfully detect TextField
class TestComponent1 extends React.Component {
  render(){
    return (
      &lt;TextField /&gt;
    )
  }
}

describe('&lt;TestComponent1 /&gt;', function(){
  it('detects TextField', function(){
    const testComponentWrapper = shallow(&lt;TestComponent1 /&gt;)

    assert.isTrue(testComponentWrapper.containsMatchingElement(&lt;TextField /&gt;))
  })
})


// Fails to detect TextField
class TestComponent2 extends React.Component {
  render(){
    return (
      &lt;TextField
        fullWidth={true}
      /&gt;
    )
  }
}

describe('&lt;TestComponent2 /&gt;', function(){
  it('detects TextField', function(){
    const testComponentWrapper = shallow(&lt;TestComponent2 /&gt;)

    assert.isTrue(testComponentWrapper.containsMatchingElement(&lt;TextField /&gt;))
  })
})"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-v">React</span> <span class="pl-k">from</span> <span class="pl-s">'react'</span>
<span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-s1">assert</span><span class="pl-kos">,</span> <span class="pl-s1">expect</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'chai'</span>
<span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-s1">shallow</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'enzyme'</span>

<span class="pl-k">import</span> <span class="pl-v">TextField</span> <span class="pl-k">from</span> <span class="pl-s">'material-ui/TextField'</span>

<span class="pl-c">// Successfully detect TextField</span>
<span class="pl-k">class</span> <span class="pl-v">TestComponent1</span> <span class="pl-k">extends</span> <span class="pl-v">React</span><span class="pl-kos">.</span><span class="pl-c1">Component</span> <span class="pl-kos">{</span>
  <span class="pl-en">render</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">{</span>
    <span class="pl-k">return</span> <span class="pl-kos">(</span>
      <span class="pl-c1">&lt;</span><span class="pl-ent">TextField</span> <span class="pl-c1">/</span><span class="pl-c1">&gt;</span>
    <span class="pl-kos">)</span>
  <span class="pl-kos">}</span>
<span class="pl-kos">}</span>

<span class="pl-en">describe</span><span class="pl-kos">(</span><span class="pl-s">'&lt;TestComponent1 /&gt;'</span><span class="pl-kos">,</span> <span class="pl-k">function</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">{</span>
  <span class="pl-en">it</span><span class="pl-kos">(</span><span class="pl-s">'detects TextField'</span><span class="pl-kos">,</span> <span class="pl-k">function</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">{</span>
    <span class="pl-k">const</span> <span class="pl-s1">testComponentWrapper</span> <span class="pl-c1">=</span> <span class="pl-en">shallow</span><span class="pl-kos">(</span><span class="pl-c1">&lt;</span><span class="pl-ent">TestComponent1</span> <span class="pl-c1">/</span><span class="pl-c1">&gt;</span><span class="pl-kos">)</span>

    <span class="pl-s1">assert</span><span class="pl-kos">.</span><span class="pl-en">isTrue</span><span class="pl-kos">(</span><span class="pl-s1">testComponentWrapper</span><span class="pl-kos">.</span><span class="pl-en">containsMatchingElement</span><span class="pl-kos">(</span><span class="pl-c1">&lt;</span><span class="pl-ent">TextField</span> <span class="pl-c1">/</span><span class="pl-c1">&gt;</span><span class="pl-kos">)</span><span class="pl-kos">)</span>
  <span class="pl-kos">}</span><span class="pl-kos">)</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span>


<span class="pl-c">// Fails to detect TextField</span>
<span class="pl-k">class</span> <span class="pl-v">TestComponent2</span> <span class="pl-k">extends</span> <span class="pl-v">React</span><span class="pl-kos">.</span><span class="pl-c1">Component</span> <span class="pl-kos">{</span>
  <span class="pl-en">render</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">{</span>
    <span class="pl-k">return</span> <span class="pl-kos">(</span>
      <span class="pl-c1">&lt;</span><span class="pl-ent">TextField</span>
        <span class="pl-c1">fullWidth</span><span class="pl-c1">=</span><span class="pl-kos">{</span><span class="pl-c1">true</span><span class="pl-kos">}</span>
      <span class="pl-c1">/</span><span class="pl-c1">&gt;</span>
    <span class="pl-kos">)</span>
  <span class="pl-kos">}</span>
<span class="pl-kos">}</span>

<span class="pl-en">describe</span><span class="pl-kos">(</span><span class="pl-s">'&lt;TestComponent2 /&gt;'</span><span class="pl-kos">,</span> <span class="pl-k">function</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">{</span>
  <span class="pl-en">it</span><span class="pl-kos">(</span><span class="pl-s">'detects TextField'</span><span class="pl-kos">,</span> <span class="pl-k">function</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">{</span>
    <span class="pl-k">const</span> <span class="pl-s1">testComponentWrapper</span> <span class="pl-c1">=</span> <span class="pl-en">shallow</span><span class="pl-kos">(</span><span class="pl-c1">&lt;</span><span class="pl-ent">TestComponent2</span> <span class="pl-c1">/</span><span class="pl-c1">&gt;</span><span class="pl-kos">)</span>

    <span class="pl-s1">assert</span><span class="pl-kos">.</span><span class="pl-en">isTrue</span><span class="pl-kos">(</span><span class="pl-s1">testComponentWrapper</span><span class="pl-kos">.</span><span class="pl-en">containsMatchingElement</span><span class="pl-kos">(</span><span class="pl-c1">&lt;</span><span class="pl-ent">TextField</span> <span class="pl-c1">/</span><span class="pl-c1">&gt;</span><span class="pl-kos">)</span><span class="pl-kos">)</span>
  <span class="pl-kos">}</span><span class="pl-kos">)</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div>
<h2 dir="auto">Context</h2>
    
<p dir="auto">Trying to use best practice <code class="notranslate">containsMatchingElement(Element w/ Props)</code> instead of <code class="notranslate">find(Element).props()</code></p>
<h2 dir="auto">Your Environment</h2>

<table role="table">
<thead>
<tr>
<th>Tech</th>
<th>Version</th>
</tr>
</thead>
<tbody>
<tr>
<td>Material-UI</td>
<td>0.19.4</td>
</tr>
<tr>
<td>React</td>
<td>15.6.2</td>
</tr>
<tr>
<td>enzyme</td>
<td>3.1.1</td>
</tr>
</tbody>
</table>
<p dir="auto">The top component is AppContainer, which yields the App component which build as a class. App component is wrapped with the MuiThemeProvider wrapper, which has one child - div element. In the console there is a warning "Warning: Failed prop type: The prop 'theme' is marked as required in 'MuiThemeProvideWrapper', but its value is 'undefined'."<br>
I later get the error "Uncaught TypeError: Cannot read property 'prepareStyles' of undefined<br>
at DatePicker.render" which seems to be related. According to the documentation there is no need to provide a theme as the Light Theme is used as default (<a href="http://www.material-ui.com/#/customization/themes" rel="nofollow">http://www.material-ui.com/#/customization/themes</a> &amp; <a href="http://www.material-ui.com/#/get-started/usage" rel="nofollow">http://www.material-ui.com/#/get-started/usage</a>). However, the problem persists also when I apply the Dark Theme according to instuctions on the Theme page.<br>
I couldn't find any info about this warning.</p>


<ul dir="auto">
<li>[ x] I have searched the <a href="https://github.com/mui-org/material-ui/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h2 dir="auto">Steps to Reproduce (for bugs)</h2>
<p dir="auto">Here is a link to the app with the warnings and errors in the console:<br>
Here is a link to my code: <a href="https://github.com/carpben/notifications/tree/master/src">https://github.com/carpben/notifications/tree/master/src</a></p>

<ol dir="auto">
<li>npm install material-ui -S</li>
<li>in the top component import MuiThemeProvider.<br>
3.render MuiThemeProvider with one child</li>
<li>Render a material Ui Component somewhere in your app.</li>
</ol>
<h2 dir="auto">Context</h2>

<p dir="auto">At the moment I can't use Material UI at all.</p>
<h2 dir="auto">Your Environment</h2>

<table role="table">
<thead>
<tr>
<th>Tech</th>
<th>Version</th>
</tr>
</thead>
<tbody>
<tr>
<td>Material-UI</td>
<td>0.22</td>
</tr>
<tr>
<td>React</td>
<td>16</td>
</tr>
<tr>
<td>browser</td>
<td>chrome</td>
</tr>
<tr>
<td>etc</td>
<td>Windows 10, create react app, redux, bash on ubuntu on windows</td>
</tr>
</tbody>
</table>