Code coverage report for src/components/student-dashboard/this-week-panel.cjsx

Statements: 100% (15 / 15)      Branches: 100% (2 / 2)      Functions: 100% (1 / 1)      Lines: 100% (15 / 15)      Ignored: none     

All files » src/components/student-dashboard/ » this-week-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                           21× 21× 21× 21× 12×                        
var BS, EmptyPanel, Events, React, StudentDashboardStore, TimeStore, moment;
 
React = require('react');
 
BS = require('react-bootstrap');
 
moment = require('moment');
 
Events = require('./events-panel');
 
EmptyPanel = require('./empty-panel');
 
TimeStore = require('../../flux/time').TimeStore;
 
StudentDashboardStore = require('../../flux/student-dashboard').StudentDashboardStore;
 
module.exports = React.createClass({
  displayName: 'ThisWeekPanel',
  propTypes: {
    courseId: React.PropTypes.string.isRequired
  },
  render: function() {
    var events, startAt;
    startAt = moment(TimeStore.getNow()).startOf('isoweek');
    events = StudentDashboardStore.weeklyEventsForDay(this.props.courseId, startAt);
    if (events.length) {
      return React.createElement(Events, {
        "className": '-this-week',
        "courseId": this.props.courseId,
        "events": events,
        "startAt": startAt,
        "endAt": startAt.clone().add(1, 'week').subtract(1, 'second')
      });
    } else {
      return React.createElement(EmptyPanel, null);
    }
  }
});