Code coverage report for src/components/performance-forecast/weaker-sections.cjsx

Statements: 100% (19 / 19)      Branches: 100% (2 / 2)      Functions: 100% (3 / 3)      Lines: 100% (19 / 19)      Ignored: none     

All files » src/components/performance-forecast/ » weaker-sections.cjsx
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51                                       20× 20× 20× 20× 39× 39×         20×     24×              
var BS, PerformanceForecast, PracticeButton, React, Router, Section, WeakerSections, _;
 
React = require('react');
 
BS = require('react-bootstrap');
 
Router = require('react-router');
 
_ = require('underscore');
 
PracticeButton = require('./practice-button');
 
PerformanceForecast = require('../../flux/performance-forecast');
 
Section = require('./section');
 
WeakerSections = React.createClass({displayName: "WeakerSections",
  propTypes: {
    courseId: React.PropTypes.string.isRequired,
    sections: React.PropTypes.array.isRequired,
    weakerEmptyMessage: React.PropTypes.string.isRequired,
    sampleSizeThreshold: React.PropTypes.number.isRequired
  },
  renderLackingData: function() {
    return React.createElement("div", {
      "className": 'lacking-data'
    }, this.props.weakerEmptyMessage);
  },
  renderSections: function() {
    var i, j, len, ref, results, section;
    ref = PerformanceForecast.Helpers.weakestSections(this.props.sections, this.props.sampleSizeThreshold);
    results = [];
    for (i = j = 0, len = ref.length; j < len; i = ++j) {
      section = ref[i];
      results.push(React.createElement(Section, React.__spread({
        "key": i,
        "section": section
      }, this.props)));
    }
    return results;
  },
  render: function() {
    return React.createElement("div", {
      "className": 'sections'
    }, (PerformanceForecast.Helpers.canDisplayWeakest(this.props) ? this.renderSections() : this.renderLackingData()));
  }
});
 
module.exports = WeakerSections;