all files / in-line/ non-linear.jsx

40% Statements 8/20
25% Branches 3/12
14.29% Functions 1/7
40% Lines 6/15
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 45 46 47 48 49                                                                                      
E// import axios from 'axios';
import React from 'react';
import BaseResource from '../resources/base-resource';
import { getVastDurationInMillis } from '../helpers/duration';
 
class NonLinear extends React.Components {
  constructor(props) {
    super(props);
    this.durationMillis = getVastDurationInMillis(this.props.duration);
  }
 
  onStartedTracking() {
 
  }
 
  onCompletedTracking() {
 
  }
 
  componentDidMount() {
    this.onStartedTracking();
    setTimeout((e) => {
      this.onCompletedTracking();
      this.props.onEnded(e);
    }, this.durationMillis);
  }
 
  render() {
    return (
      <BaseResource
        baseResource={this.props.nonLinear}
        height={this.props.height}
        width={this.props.width}
      />
    );
  }
}
 
NonLinear.propTypes = {
  tracking: React.PropTypes.object,
  onEnded: React.PropTypes.func,
  nonLinear: React.PropTypes.object,
  height: React.PropTypes.number,
  width: React.PropTypes.number,
  duration: React.PropTypes.string,
};
 
export default NonLinear;