Code coverage report for src/components/app.cjsx

Statements: 100% (16 / 16)      Branches: 100% (0 / 0)      Functions: 100% (5 / 5)      Lines: 100% (16 / 16)      Ignored: none     

All files » src/components/ » app.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                         54× 54× 54×     53×     54×         54× 54×     95×            
var Analytics, History, HistoryLocation, Navbar, React, RouteHandler, SpyMode, TransitionActions, TransitionStore, ref, ref1;
 
React = require('react');
 
ref = require('react-router'), HistoryLocation = ref.HistoryLocation, History = ref.History, RouteHandler = ref.RouteHandler;
 
Navbar = require('./navbar');
 
Analytics = require('../helpers/analytics');
 
SpyMode = require('openstax-react-components').SpyMode;
 
ref1 = require('../flux/transition'), TransitionActions = ref1.TransitionActions, TransitionStore = ref1.TransitionStore;
 
module.exports = React.createClass({
  displayName: 'App',
  contextTypes: {
    router: React.PropTypes.func
  },
  componentDidMount: function() {
    this.storeInitial();
    Analytics.setTracker(window.ga);
    return HistoryLocation.addChangeListener(this.storeHistory);
  },
  componentWillUnmount: function() {
    return HistoryLocation.removeChangeListener(this.storeHistory);
  },
  storeInitial: function() {
    return this.storeHistory({
      path: this.context.router.getCurrentPath()
    });
  },
  storeHistory: function(locationChangeEvent) {
    Analytics.onNavigation(locationChangeEvent, this.context.router);
    return TransitionActions.load(locationChangeEvent, this.context.router);
  },
  render: function() {
    return React.createElement("div", {
      "className": 'tutor-app openstax-wrapper'
    }, React.createElement(SpyMode.Wrapper, null, React.createElement(Navbar, null), React.createElement(RouteHandler, null)));
  }
});