Code coverage report for src/components/cc-dashboard/section-performance.cjsx

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

All files » src/components/cc-dashboard/ » section-performance.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         82× 82×     82× 82× 73× 73× 73×               82× 72× 72×               82×              
var BS, React, SectionPerformance;
 
React = require('react');
 
BS = require('react-bootstrap');
 
SectionPerformance = React.createClass({displayName: "SectionPerformance",
  render: function() {
    var correctBar, correctLabel, incorrectBar, incorrectLabel, percents;
    percents = {
      correct: this.props.performance ? Math.round(this.props.performance * 100) : 0
    };
    percents.incorrect = 100 - percents.correct;
    if (percents.correct) {
      correctLabel = percents.correct + "%";
      correctLabel = percents.correct === 100 ? correctLabel + " correct" : correctLabel;
      correctBar = React.createElement(BS.ProgressBar, {
        "className": "reading-progress-bar progress-bar-correct",
        "now": percents.correct,
        "label": correctLabel,
        "type": "correct",
        "key": 1.
      });
    }
    if (percents.incorrect) {
      incorrectLabel = percents.incorrect === 100 ? percents.incorrect + "% incorrect" : void 0;
      incorrectBar = React.createElement(BS.ProgressBar, {
        "className": "reading-progress-bar progress-bar-incorrect",
        "now": percents.incorrect,
        "label": incorrectLabel,
        "type": "incorrect",
        "key": 2.
      });
    }
    return React.createElement("div", null, React.createElement(BS.ProgressBar, {
      "className": "reading-progress-group"
    }, correctBar, incorrectBar));
  }
});
 
module.exports = SectionPerformance;