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

Statements: 100% (16 / 16)      Branches: 100% (6 / 6)      Functions: 100% (1 / 1)      Lines: 100% (16 / 16)      Ignored: none     

All files » src/components/performance-forecast/ » weaker-panel.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 52                                       21× 21×   20× 16×           20×                      
var BS, PerformanceForecast, PracticeButton, React, Router, WeakerPanel, WeakerSections, _;
 
React = require('react');
 
BS = require('react-bootstrap');
 
Router = require('react-router');
 
_ = require('underscore');
 
PerformanceForecast = require('../../flux/performance-forecast');
 
PracticeButton = require('./practice-button');
 
WeakerSections = require('./weaker-sections');
 
WeakerPanel = React.createClass({displayName: "WeakerPanel",
  propTypes: {
    courseId: React.PropTypes.string.isRequired,
    sections: React.PropTypes.array.isRequired,
    weakerTitle: React.PropTypes.string.isRequired,
    weakerExplanation: React.PropTypes.element.isRequired,
    weakerEmptyMessage: React.PropTypes.string.isRequired,
    onPractice: React.PropTypes.func,
    sectionCount: React.PropTypes.number,
    sampleSizeThreshold: React.PropTypes.number.isRequired
  },
  render: function() {
    var practiceBtn;
    if (this.props.sections.length === 0) {
      return null;
    }
    if (this.props.onPractice && PerformanceForecast.Helpers.canDisplayWeakest(this.props)) {
      practiceBtn = React.createElement(PracticeButton, {
        "title": 'Practice All',
        "sections": PerformanceForecast.Helpers.weakestSections(this.props.sections),
        "courseId": this.props.courseId
      });
    }
    return React.createElement("div", {
      "className": "chapter-panel weaker"
    }, React.createElement("div", {
      "className": 'chapter metric'
    }, React.createElement("span", {
      "className": 'title'
    }, this.props.weakerTitle), this.props.weakerExplanation, practiceBtn), React.createElement(WeakerSections, React.__spread({}, this.props)));
  }
});
 
module.exports = WeakerPanel;