Code coverage report for src/components/student-dashboard/upcoming-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/ » upcoming-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× 18×                        
var BS, EmptyPanel, EventsPanel, React, StudentDashboardStore, TimeStore, moment;
 
React = require('react');
 
BS = require('react-bootstrap');
 
moment = require('moment');
 
EventsPanel = require('./events-panel');
 
EmptyPanel = require('./empty-panel');
 
TimeStore = require('../../flux/time').TimeStore;
 
StudentDashboardStore = require('../../flux/student-dashboard').StudentDashboardStore;
 
module.exports = React.createClass({
  displayName: 'UpcomingPanel',
  propTypes: {
    courseId: React.PropTypes.string.isRequired
  },
  render: function() {
    var events, startAt;
    startAt = moment(TimeStore.getNow()).startOf('isoweek').add(1, 'week');
    events = StudentDashboardStore.upcomingEvents(this.props.courseId, startAt);
    if (events.length) {
      return React.createElement(EventsPanel, {
        "className": '-upcoming',
        "onTaskClick": this.onTaskClick,
        "courseId": this.props.courseId,
        "events": events,
        "title": 'Coming Up'
      });
    } else {
      return React.createElement(EmptyPanel, null, "No upcoming events");
    }
  }
});