title: TypeError: Cannot read property 'length' of undefined
body: <p>I don't get while running the application, it only happens when i run test. Basically I have written snapshot test for now.</p>
  
  <blockquote>
    <p>TypeError: Cannot read property 'length' of undefined  at
    Papertype.render (src/components/layoutcomponents/papertype.js:50:23)</p>
  </blockquote>
  
  <p>Here is code in papertype.js</p>
  
  <pre><code>import React, { Component } from 'react';
  
  import common from '../../jsons/common.json';
  
  import catalogSpecs from '../../jsons/infiniti.json';
  
  
  class Papertype extends Component {
  
      constructor(props) {
  
          super(props);
  
          this.state = {
  
              paperType: "Regular",
  
              regularPaper : true,
  
              heavyPaper : false
          }
      }
      changePaperTypeLayoutParams(event){
  
          let nameSelection = event.target.value;
  
          let lalala = catalogSpecs.commonProps.paperType.paperTypeDefinitionDTOs
  
          let paperTypebinding = lalala[nameSelection].absolutelayflat;
  
          let paperLaminationVisibility = lalala[nameSelection].paperLamination;
  
          this.setState({
  
              paperType: nameSelection
  
          });
  
          if(nameSelection.indexOf("Regular")&gt;-1 || 
  
  nameSelection.indexOf("Metallic")&gt;-1){
  
              this.setState({
  
                  regularPaper : true,
  
                  heavyPaper : false
              });
              this.props.setRegularOrHeavy(true,false,paperTypebinding,paperLaminationVisibility);
  
          }else{
  
              this.setState({
  
                  heavyPaper : true,
  
                  regularPaper : false
  
              });
              this.props.setRegularOrHeavy(false,true,paperTypebinding,paperLaminationVisibility);
          }
  
  
  
      }
      render() {
  
          let validLayoutPaperType=this.props.validLayoutPaperType;
  
          let paperTypeOptions = [];
          let paperTypeOpts = common.paperTypeOpts;
          for(let i=0;i&lt;validLayoutPaperType.length;i++){
              let paper = paperTypeOpts[validLayoutPaperType[i]]
              paperTypeOptions.push(&lt;option label={paper} value={paper} key={i}&gt;{paper}&lt;/option&gt;)
          }
          return(
              &lt;div className="layout-item"&gt;
                  &lt;label&gt;Paper Type&lt;/label&gt;
                  &lt;div className="custom-select"&gt;
                      &lt;select className="form-control" onChange={this.changePaperTypeLayoutParams.bind(this)}&gt;
                          {paperTypeOptions}
                      &lt;/select&gt;
                      &lt;i className="icon icon-angle-down"&gt;&lt;/i&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          )
      }
  }
  export default Papertype;
  </code></pre>