Code coverage report for src/components/course-grouping-label.cjsx

Statements: 100% (17 / 17)      Branches: 100% (8 / 8)      Functions: 100% (3 / 3)      Lines: 100% (17 / 17)      Ignored: none     

All files » src/components/ » course-grouping-label.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                   77× 27×   50×       237×   235×       314× 314× 314× 314× 74×   314×          
var CourseGroupingLabel, CourseStore, React;
 
React = require('react');
 
CourseStore = require('../flux/course').CourseStore;
 
CourseGroupingLabel = React.createClass({displayName: "CourseGroupingLabel",
  propTypes: {
    courseId: React.PropTypes.string.isRequired,
    plural: React.PropTypes.bool,
    lowercase: React.PropTypes.bool
  },
  section: function() {
    if (this.props.lowercase) {
      return 'section';
    } else {
      return 'Section';
    }
  },
  period: function() {
    if (this.props.lowercase) {
      return 'period';
    } else {
      return 'Period';
    }
  },
  render: function() {
    var is_concept_coach, name;
    is_concept_coach = CourseStore.get(this.props.courseId).is_concept_coach;
    name = is_concept_coach ? this.section() : this.period();
    if (this.props.plural) {
      name += 's';
    }
    return React.createElement("span", null, name);
  }
});
 
module.exports = CourseGroupingLabel;