Added tests for helpers and components. All react components are now ES5.
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
var React = require('react');
|
||||
var ReactAddons = require('react/addons');
|
||||
var ReactCSSTransitionGroup = ReactAddons.addons.CSSTransitionGroup;
|
||||
var classNames = require('classnames');
|
||||
|
||||
var Alert = React.createClass({
|
||||
|
||||
@@ -1,13 +1,8 @@
|
||||
//jshint esnext:true
|
||||
|
||||
var React = require('react');
|
||||
|
||||
class MainList extends React.Component {
|
||||
componentDidMount() {
|
||||
var MainList = React.createClass({
|
||||
|
||||
}
|
||||
|
||||
_openOptionsPage() {
|
||||
_openOptionsPage: function() {
|
||||
if (chrome.runtime.openOptionsPage) {
|
||||
// New way to open options pages, if supported (Chrome 42+).
|
||||
chrome.runtime.openOptionsPage();
|
||||
@@ -15,14 +10,17 @@ class MainList extends React.Component {
|
||||
// Reasonable fallback.
|
||||
window.open(chrome.runtime.getURL('options.html'));
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
render() {
|
||||
var loginLogoutButton = () => {
|
||||
if (this.props.loggedIn === true) {
|
||||
render: function() {
|
||||
|
||||
var that = this;
|
||||
|
||||
var loginLogoutButton = function() {
|
||||
if (that.props.loggedIn === true) {
|
||||
return (
|
||||
<div>
|
||||
<a href="#" className="list-group-item" onClick={this.props.logoutUser}>
|
||||
<a href="#" className="list-group-item" onClick={that.props.logoutUser}>
|
||||
<i className="fa fa-fw fa-sign-out"></i>
|
||||
Logout
|
||||
</a>
|
||||
@@ -39,26 +37,26 @@ class MainList extends React.Component {
|
||||
};
|
||||
|
||||
// If logging is enabled, display that info to user
|
||||
var loggingStatus = () => {
|
||||
if(this.props.loggingEnabled === true && this.props.loggedIn === true)
|
||||
var loggingStatus = function() {
|
||||
if(that.props.loggingEnabled === true && that.props.loggedIn === true)
|
||||
{
|
||||
return (
|
||||
<div className="row">
|
||||
<div className="col-xs-12">
|
||||
<p>
|
||||
<a href="#" onClick={this.props.disableLogging} className="btn btn-danger btn-block">Disable logging</a>
|
||||
<a href="#" onClick={that.props.disableLogging} className="btn btn-danger btn-block">Disable logging</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
else if(this.props.loggingEnabled === false && this.props.loggedIn === true)
|
||||
else if(that.props.loggingEnabled === false && that.props.loggedIn === true)
|
||||
{
|
||||
return (
|
||||
<div className="row">
|
||||
<div className="col-xs-12">
|
||||
<p>
|
||||
<a href="#" onClick={this.props.enableLogging} className="btn btn-success btn-block">Enable logging</a>
|
||||
<a href="#" onClick={that.props.enableLogging} className="btn btn-success btn-block">Enable logging</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -66,13 +64,13 @@ class MainList extends React.Component {
|
||||
}
|
||||
};
|
||||
|
||||
var totalTimeLoggedToday = () => {
|
||||
if (this.props.loggedIn === true) {
|
||||
var totalTimeLoggedToday = function() {
|
||||
if (that.props.loggedIn === true) {
|
||||
return (
|
||||
<div className="row">
|
||||
<div className="col-xs-12">
|
||||
<blockquote>
|
||||
<p>{this.props.totalTimeLoggedToday}</p>
|
||||
<p>{that.props.totalTimeLoggedToday}</p>
|
||||
<small><cite>TOTAL TIME LOGGED TODAY</cite></small>
|
||||
</blockquote>
|
||||
</div>
|
||||
@@ -100,6 +98,7 @@ class MainList extends React.Component {
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default MainList;
|
||||
});
|
||||
|
||||
module.exports = MainList;
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
//jshint esnext:true
|
||||
|
||||
var React = require('react');
|
||||
|
||||
class Navbar extends React.Component {
|
||||
var Navbar = React.createClass({
|
||||
|
||||
render() {
|
||||
render: function() {
|
||||
|
||||
var signedInAs = () => {
|
||||
if (this.props.loggedIn === true) {
|
||||
var that = this;
|
||||
|
||||
var signedInAs = function() {
|
||||
if (that.props.loggedIn === true) {
|
||||
return (
|
||||
<p className="navbar-text">Signed in as <b>{this.props.user.full_name}</b></p>
|
||||
<p className="navbar-text">Signed in as <b>{that.props.user.full_name}</b></p>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
var dashboard = () => {
|
||||
if (this.props.loggedIn === true) {
|
||||
var dashboard = function() {
|
||||
if (that.props.loggedIn === true) {
|
||||
return (
|
||||
<li>
|
||||
<a target="_blank" href="https://wakatime.com/dashboard">
|
||||
@@ -27,8 +27,8 @@ class Navbar extends React.Component {
|
||||
}
|
||||
};
|
||||
|
||||
var customRules = () => {
|
||||
if (this.props.loggedIn === true) {
|
||||
var customRules = function() {
|
||||
if (that.props.loggedIn === true) {
|
||||
return (
|
||||
<li>
|
||||
<a target="_blank" href="https://wakatime.com/settings/rules">
|
||||
@@ -84,6 +84,6 @@ class Navbar extends React.Component {
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
export default Navbar;
|
||||
module.exports = Navbar;
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
//jshint esnext:true
|
||||
|
||||
var React = require("react");
|
||||
var $ = require('jquery');
|
||||
|
||||
@@ -15,13 +13,10 @@ var WakaTimeOriginal = require('../core/WakaTime');
|
||||
// Helpers
|
||||
var changeExtensionState = require('../helpers/changeExtensionState');
|
||||
|
||||
class WakaTime extends React.Component {
|
||||
var WakaTime = React.createClass({
|
||||
|
||||
constructor(props){
|
||||
|
||||
super(props);
|
||||
|
||||
this.state = {
|
||||
getInitialState: function() {
|
||||
return {
|
||||
user: {
|
||||
full_name: null,
|
||||
email: null,
|
||||
@@ -31,21 +26,23 @@ class WakaTime extends React.Component {
|
||||
loggingEnabled: config.loggingEnabled,
|
||||
totalTimeLoggedToday: '0 minutes'
|
||||
};
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
componentDidMount() {
|
||||
componentDidMount: function() {
|
||||
|
||||
var wakatime = new WakaTimeOriginal;
|
||||
|
||||
wakatime.checkAuth().done(data => {
|
||||
var that = this;
|
||||
|
||||
wakatime.checkAuth().done(function(data) {
|
||||
|
||||
if (data !== false) {
|
||||
|
||||
chrome.storage.sync.get({
|
||||
loggingEnabled: config.loggingEnabled
|
||||
}, (items) => {
|
||||
this.setState({loggingEnabled: items.loggingEnabled});
|
||||
}, function(items) {
|
||||
that.setState({loggingEnabled: items.loggingEnabled});
|
||||
|
||||
if (items.loggingEnabled === true) {
|
||||
changeExtensionState('allGood');
|
||||
}
|
||||
@@ -54,7 +51,7 @@ class WakaTime extends React.Component {
|
||||
}
|
||||
});
|
||||
|
||||
this.setState({
|
||||
that.setState({
|
||||
user: {
|
||||
full_name: data.full_name,
|
||||
email: data.email,
|
||||
@@ -63,10 +60,10 @@ class WakaTime extends React.Component {
|
||||
loggedIn: true
|
||||
});
|
||||
|
||||
wakatime.getTotalTimeLoggedToday().done((grand_total) => {
|
||||
this.setState({
|
||||
wakatime.getTotalTimeLoggedToday().done(function(grand_total) {
|
||||
that.setState({
|
||||
totalTimeLoggedToday: grand_total['text']
|
||||
})
|
||||
});
|
||||
});
|
||||
}
|
||||
else {
|
||||
@@ -74,34 +71,39 @@ class WakaTime extends React.Component {
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
logoutUser() {
|
||||
logoutUser: function() {
|
||||
var deferredObject = $.Deferred();
|
||||
|
||||
var that = this;
|
||||
|
||||
$.ajax({
|
||||
url: config.logoutUserUrl,
|
||||
method: 'GET',
|
||||
success: () => {
|
||||
success: function() {
|
||||
|
||||
deferredObject.resolve(this);
|
||||
deferredObject.resolve(that);
|
||||
|
||||
},
|
||||
error: (xhr, status, err) => {
|
||||
|
||||
console.error(config.logoutUserUrl, status, err.toString());
|
||||
|
||||
deferredObject.resolve(this);
|
||||
deferredObject.resolve(that);
|
||||
}
|
||||
});
|
||||
|
||||
return deferredObject.promise();
|
||||
}
|
||||
},
|
||||
|
||||
_logoutUser() {
|
||||
this.logoutUser().done(() => {
|
||||
_logoutUser: function() {
|
||||
|
||||
this.setState({
|
||||
var that = this;
|
||||
|
||||
this.logoutUser().done(function(){
|
||||
|
||||
that.setState({
|
||||
user: {
|
||||
full_name: null,
|
||||
email: null,
|
||||
@@ -114,9 +116,9 @@ class WakaTime extends React.Component {
|
||||
changeExtensionState('notSignedIn');
|
||||
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
_disableLogging() {
|
||||
_disableLogging: function() {
|
||||
this.setState({
|
||||
loggingEnabled: false
|
||||
});
|
||||
@@ -126,9 +128,9 @@ class WakaTime extends React.Component {
|
||||
chrome.storage.sync.set({
|
||||
loggingEnabled: false
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
_enableLogging() {
|
||||
_enableLogging: function() {
|
||||
this.setState({
|
||||
loggingEnabled: true
|
||||
});
|
||||
@@ -138,10 +140,9 @@ class WakaTime extends React.Component {
|
||||
chrome.storage.sync.set({
|
||||
loggingEnabled: true
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
render() {
|
||||
render: function() {
|
||||
return (
|
||||
<div>
|
||||
<NavBar
|
||||
@@ -151,12 +152,12 @@ class WakaTime extends React.Component {
|
||||
<div className="row">
|
||||
<div className="col-md-12">
|
||||
<MainList
|
||||
disableLogging={this._disableLogging.bind(this)}
|
||||
enableLogging={this._enableLogging.bind(this)}
|
||||
disableLogging={this._disableLogging}
|
||||
enableLogging={this._enableLogging}
|
||||
loggingEnabled={this.state.loggingEnabled}
|
||||
user={this.state.user}
|
||||
totalTimeLoggedToday={this.state.totalTimeLoggedToday}
|
||||
logoutUser={this._logoutUser.bind(this)}
|
||||
logoutUser={this._logoutUser}
|
||||
loggedIn={this.state.loggedIn} />
|
||||
</div>
|
||||
</div>
|
||||
@@ -164,6 +165,7 @@ class WakaTime extends React.Component {
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default WakaTime;
|
||||
});
|
||||
|
||||
module.exports = WakaTime;
|
||||
|
||||
@@ -44,6 +44,7 @@ var config = {
|
||||
'blacklisted',
|
||||
'whitelisted'
|
||||
],
|
||||
// Predefined alert type and text for success and failure.
|
||||
alert: {
|
||||
success: {
|
||||
type: 'success',
|
||||
|
||||
@@ -15,349 +15,283 @@ React.render(React.createElement(WakaTime, null), document.getElementById('wakat
|
||||
|
||||
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
||||
},{"./components/WakaTime.react":4,"bootstrap":13,"jquery":26,"react":183}],2:[function(require,module,exports){
|
||||
//jshint esnext:true
|
||||
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
|
||||
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; }
|
||||
|
||||
var React = require('react');
|
||||
|
||||
var MainList = (function (_React$Component) {
|
||||
function MainList() {
|
||||
_classCallCheck(this, MainList);
|
||||
var MainList = React.createClass({
|
||||
displayName: 'MainList',
|
||||
|
||||
if (_React$Component != null) {
|
||||
_React$Component.apply(this, arguments);
|
||||
_openOptionsPage: function _openOptionsPage() {
|
||||
if (chrome.runtime.openOptionsPage) {
|
||||
// New way to open options pages, if supported (Chrome 42+).
|
||||
chrome.runtime.openOptionsPage();
|
||||
} else {
|
||||
// Reasonable fallback.
|
||||
window.open(chrome.runtime.getURL('options.html'));
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
_inherits(MainList, _React$Component);
|
||||
render: function render() {
|
||||
|
||||
_createClass(MainList, [{
|
||||
key: 'componentDidMount',
|
||||
value: function componentDidMount() {}
|
||||
}, {
|
||||
key: '_openOptionsPage',
|
||||
value: function _openOptionsPage() {
|
||||
if (chrome.runtime.openOptionsPage) {
|
||||
// New way to open options pages, if supported (Chrome 42+).
|
||||
chrome.runtime.openOptionsPage();
|
||||
} else {
|
||||
// Reasonable fallback.
|
||||
window.open(chrome.runtime.getURL('options.html'));
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: 'render',
|
||||
value: function render() {
|
||||
var _this = this;
|
||||
|
||||
var loginLogoutButton = function loginLogoutButton() {
|
||||
if (_this.props.loggedIn === true) {
|
||||
return React.createElement(
|
||||
'div',
|
||||
null,
|
||||
React.createElement(
|
||||
'a',
|
||||
{ href: '#', className: 'list-group-item', onClick: _this.props.logoutUser },
|
||||
React.createElement('i', { className: 'fa fa-fw fa-sign-out' }),
|
||||
'Logout'
|
||||
)
|
||||
);
|
||||
}
|
||||
var that = this;
|
||||
|
||||
var loginLogoutButton = function loginLogoutButton() {
|
||||
if (that.props.loggedIn === true) {
|
||||
return React.createElement(
|
||||
'a',
|
||||
{ target: '_blank', href: 'https://wakatime.com/login', className: 'list-group-item' },
|
||||
React.createElement('i', { className: 'fa fa-fw fa-sign-in' }),
|
||||
'Login'
|
||||
);
|
||||
};
|
||||
|
||||
// If logging is enabled, display that info to user
|
||||
var loggingStatus = function loggingStatus() {
|
||||
if (_this.props.loggingEnabled === true && _this.props.loggedIn === true) {
|
||||
return React.createElement(
|
||||
'div',
|
||||
{ className: 'row' },
|
||||
React.createElement(
|
||||
'div',
|
||||
{ className: 'col-xs-12' },
|
||||
React.createElement(
|
||||
'p',
|
||||
null,
|
||||
React.createElement(
|
||||
'a',
|
||||
{ href: '#', onClick: _this.props.disableLogging, className: 'btn btn-danger btn-block' },
|
||||
'Disable logging'
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
} else if (_this.props.loggingEnabled === false && _this.props.loggedIn === true) {
|
||||
return React.createElement(
|
||||
'div',
|
||||
{ className: 'row' },
|
||||
React.createElement(
|
||||
'div',
|
||||
{ className: 'col-xs-12' },
|
||||
React.createElement(
|
||||
'p',
|
||||
null,
|
||||
React.createElement(
|
||||
'a',
|
||||
{ href: '#', onClick: _this.props.enableLogging, className: 'btn btn-success btn-block' },
|
||||
'Enable logging'
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
var totalTimeLoggedToday = function totalTimeLoggedToday() {
|
||||
if (_this.props.loggedIn === true) {
|
||||
return React.createElement(
|
||||
'div',
|
||||
{ className: 'row' },
|
||||
React.createElement(
|
||||
'div',
|
||||
{ className: 'col-xs-12' },
|
||||
React.createElement(
|
||||
'blockquote',
|
||||
null,
|
||||
React.createElement(
|
||||
'p',
|
||||
null,
|
||||
_this.props.totalTimeLoggedToday
|
||||
),
|
||||
React.createElement(
|
||||
'small',
|
||||
null,
|
||||
React.createElement(
|
||||
'cite',
|
||||
null,
|
||||
'TOTAL TIME LOGGED TODAY'
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
return React.createElement(
|
||||
'div',
|
||||
null,
|
||||
totalTimeLoggedToday(),
|
||||
loggingStatus(),
|
||||
React.createElement(
|
||||
'div',
|
||||
{ className: 'list-group' },
|
||||
null,
|
||||
React.createElement(
|
||||
'a',
|
||||
{ href: '#', className: 'list-group-item', onClick: this._openOptionsPage },
|
||||
React.createElement('i', { className: 'fa fa-fw fa-cogs' }),
|
||||
'Options'
|
||||
),
|
||||
loginLogoutButton()
|
||||
)
|
||||
{ href: '#', className: 'list-group-item', onClick: that.props.logoutUser },
|
||||
React.createElement('i', { className: 'fa fa-fw fa-sign-out' }),
|
||||
'Logout'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
return React.createElement(
|
||||
'a',
|
||||
{ target: '_blank', href: 'https://wakatime.com/login', className: 'list-group-item' },
|
||||
React.createElement('i', { className: 'fa fa-fw fa-sign-in' }),
|
||||
'Login'
|
||||
);
|
||||
}
|
||||
}]);
|
||||
};
|
||||
|
||||
return MainList;
|
||||
})(React.Component);
|
||||
// If logging is enabled, display that info to user
|
||||
var loggingStatus = function loggingStatus() {
|
||||
if (that.props.loggingEnabled === true && that.props.loggedIn === true) {
|
||||
return React.createElement(
|
||||
'div',
|
||||
{ className: 'row' },
|
||||
React.createElement(
|
||||
'div',
|
||||
{ className: 'col-xs-12' },
|
||||
React.createElement(
|
||||
'p',
|
||||
null,
|
||||
React.createElement(
|
||||
'a',
|
||||
{ href: '#', onClick: that.props.disableLogging, className: 'btn btn-danger btn-block' },
|
||||
'Disable logging'
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
} else if (that.props.loggingEnabled === false && that.props.loggedIn === true) {
|
||||
return React.createElement(
|
||||
'div',
|
||||
{ className: 'row' },
|
||||
React.createElement(
|
||||
'div',
|
||||
{ className: 'col-xs-12' },
|
||||
React.createElement(
|
||||
'p',
|
||||
null,
|
||||
React.createElement(
|
||||
'a',
|
||||
{ href: '#', onClick: that.props.enableLogging, className: 'btn btn-success btn-block' },
|
||||
'Enable logging'
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
exports['default'] = MainList;
|
||||
module.exports = exports['default'];
|
||||
var totalTimeLoggedToday = function totalTimeLoggedToday() {
|
||||
if (that.props.loggedIn === true) {
|
||||
return React.createElement(
|
||||
'div',
|
||||
{ className: 'row' },
|
||||
React.createElement(
|
||||
'div',
|
||||
{ className: 'col-xs-12' },
|
||||
React.createElement(
|
||||
'blockquote',
|
||||
null,
|
||||
React.createElement(
|
||||
'p',
|
||||
null,
|
||||
that.props.totalTimeLoggedToday
|
||||
),
|
||||
React.createElement(
|
||||
'small',
|
||||
null,
|
||||
React.createElement(
|
||||
'cite',
|
||||
null,
|
||||
'TOTAL TIME LOGGED TODAY'
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
},{"react":183}],3:[function(require,module,exports){
|
||||
//jshint esnext:true
|
||||
return React.createElement(
|
||||
'div',
|
||||
null,
|
||||
totalTimeLoggedToday(),
|
||||
loggingStatus(),
|
||||
React.createElement(
|
||||
'div',
|
||||
{ className: 'list-group' },
|
||||
React.createElement(
|
||||
'a',
|
||||
{ href: '#', className: 'list-group-item', onClick: this._openOptionsPage },
|
||||
React.createElement('i', { className: 'fa fa-fw fa-cogs' }),
|
||||
'Options'
|
||||
),
|
||||
loginLogoutButton()
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
|
||||
module.exports = MainList;
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; }
|
||||
},{"react":183}],3:[function(require,module,exports){
|
||||
"use strict";
|
||||
|
||||
var React = require("react");
|
||||
|
||||
var Navbar = (function (_React$Component) {
|
||||
function Navbar() {
|
||||
_classCallCheck(this, Navbar);
|
||||
var Navbar = React.createClass({
|
||||
displayName: "Navbar",
|
||||
|
||||
if (_React$Component != null) {
|
||||
_React$Component.apply(this, arguments);
|
||||
}
|
||||
}
|
||||
render: function render() {
|
||||
|
||||
_inherits(Navbar, _React$Component);
|
||||
var that = this;
|
||||
|
||||
_createClass(Navbar, [{
|
||||
key: "render",
|
||||
value: function render() {
|
||||
var _this = this;
|
||||
|
||||
var signedInAs = function signedInAs() {
|
||||
if (_this.props.loggedIn === true) {
|
||||
return React.createElement(
|
||||
"p",
|
||||
{ className: "navbar-text" },
|
||||
"Signed in as ",
|
||||
React.createElement(
|
||||
"b",
|
||||
null,
|
||||
_this.props.user.full_name
|
||||
)
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
var dashboard = function dashboard() {
|
||||
if (_this.props.loggedIn === true) {
|
||||
return React.createElement(
|
||||
"li",
|
||||
var signedInAs = function signedInAs() {
|
||||
if (that.props.loggedIn === true) {
|
||||
return React.createElement(
|
||||
"p",
|
||||
{ className: "navbar-text" },
|
||||
"Signed in as ",
|
||||
React.createElement(
|
||||
"b",
|
||||
null,
|
||||
React.createElement(
|
||||
"a",
|
||||
{ target: "_blank", href: "https://wakatime.com/dashboard" },
|
||||
React.createElement("i", { className: "fa fa-fw fa-tachometer" }),
|
||||
"Dashboard"
|
||||
)
|
||||
);
|
||||
}
|
||||
};
|
||||
that.props.user.full_name
|
||||
)
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
var customRules = function customRules() {
|
||||
if (_this.props.loggedIn === true) {
|
||||
return React.createElement(
|
||||
"li",
|
||||
null,
|
||||
React.createElement(
|
||||
"a",
|
||||
{ target: "_blank", href: "https://wakatime.com/settings/rules" },
|
||||
React.createElement("i", { className: "fa fa-fw fa-filter" }),
|
||||
"Custom Rules"
|
||||
)
|
||||
);
|
||||
}
|
||||
};
|
||||
var dashboard = function dashboard() {
|
||||
if (that.props.loggedIn === true) {
|
||||
return React.createElement(
|
||||
"li",
|
||||
null,
|
||||
React.createElement(
|
||||
"a",
|
||||
{ target: "_blank", href: "https://wakatime.com/dashboard" },
|
||||
React.createElement("i", { className: "fa fa-fw fa-tachometer" }),
|
||||
"Dashboard"
|
||||
)
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
return React.createElement(
|
||||
"nav",
|
||||
{ className: "navbar navbar-default", role: "navigation" },
|
||||
var customRules = function customRules() {
|
||||
if (that.props.loggedIn === true) {
|
||||
return React.createElement(
|
||||
"li",
|
||||
null,
|
||||
React.createElement(
|
||||
"a",
|
||||
{ target: "_blank", href: "https://wakatime.com/settings/rules" },
|
||||
React.createElement("i", { className: "fa fa-fw fa-filter" }),
|
||||
"Custom Rules"
|
||||
)
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
return React.createElement(
|
||||
"nav",
|
||||
{ className: "navbar navbar-default", role: "navigation" },
|
||||
React.createElement(
|
||||
"div",
|
||||
{ className: "container-fluid" },
|
||||
React.createElement(
|
||||
"div",
|
||||
{ className: "container-fluid" },
|
||||
{ className: "navbar-header" },
|
||||
React.createElement(
|
||||
"div",
|
||||
{ className: "navbar-header" },
|
||||
"button",
|
||||
{ type: "button", className: "navbar-toggle collapsed", "data-toggle": "collapse", "data-target": "#bs-example-navbar-collapse-1" },
|
||||
React.createElement(
|
||||
"button",
|
||||
{ type: "button", className: "navbar-toggle collapsed", "data-toggle": "collapse", "data-target": "#bs-example-navbar-collapse-1" },
|
||||
React.createElement(
|
||||
"span",
|
||||
{ className: "sr-only" },
|
||||
"Toggle navigation"
|
||||
),
|
||||
React.createElement("i", { className: "fa fa-fw fa-cogs" })
|
||||
"span",
|
||||
{ className: "sr-only" },
|
||||
"Toggle navigation"
|
||||
),
|
||||
React.createElement(
|
||||
"a",
|
||||
{ target: "_blank", className: "navbar-brand", href: "https://wakatime.com" },
|
||||
"WakaTime",
|
||||
React.createElement("img", { src: "graphics/wakatime-logo-48.png" })
|
||||
)
|
||||
React.createElement("i", { className: "fa fa-fw fa-cogs" })
|
||||
),
|
||||
React.createElement(
|
||||
"div",
|
||||
{ className: "collapse navbar-collapse", id: "bs-example-navbar-collapse-1" },
|
||||
signedInAs(),
|
||||
"a",
|
||||
{ target: "_blank", className: "navbar-brand", href: "https://wakatime.com" },
|
||||
"WakaTime",
|
||||
React.createElement("img", { src: "graphics/wakatime-logo-48.png" })
|
||||
)
|
||||
),
|
||||
React.createElement(
|
||||
"div",
|
||||
{ className: "collapse navbar-collapse", id: "bs-example-navbar-collapse-1" },
|
||||
signedInAs(),
|
||||
React.createElement(
|
||||
"ul",
|
||||
{ className: "nav navbar-nav" },
|
||||
customRules(),
|
||||
dashboard(),
|
||||
React.createElement(
|
||||
"ul",
|
||||
{ className: "nav navbar-nav" },
|
||||
customRules(),
|
||||
dashboard(),
|
||||
"li",
|
||||
{ className: "dropdown" },
|
||||
React.createElement(
|
||||
"li",
|
||||
{ className: "dropdown" },
|
||||
"a",
|
||||
{ href: "#", className: "dropdown-toggle", "data-toggle": "dropdown", role: "button", "aria-expanded": "false" },
|
||||
React.createElement("i", { className: "fa fa-fw fa-info" }),
|
||||
"About",
|
||||
React.createElement("span", { className: "caret" })
|
||||
),
|
||||
React.createElement(
|
||||
"ul",
|
||||
{ className: "dropdown-menu", role: "menu" },
|
||||
React.createElement(
|
||||
"a",
|
||||
{ href: "#", className: "dropdown-toggle", "data-toggle": "dropdown", role: "button", "aria-expanded": "false" },
|
||||
React.createElement("i", { className: "fa fa-fw fa-info" }),
|
||||
"About",
|
||||
React.createElement("span", { className: "caret" })
|
||||
"li",
|
||||
null,
|
||||
React.createElement(
|
||||
"a",
|
||||
{ target: "_blank", href: "https://github.com/wakatime/chrome-wakatime/issues" },
|
||||
React.createElement("i", { className: "fa fa-fw fa-bug" }),
|
||||
"Report an Issue"
|
||||
)
|
||||
),
|
||||
React.createElement(
|
||||
"ul",
|
||||
{ className: "dropdown-menu", role: "menu" },
|
||||
"li",
|
||||
null,
|
||||
React.createElement(
|
||||
"li",
|
||||
null,
|
||||
React.createElement(
|
||||
"a",
|
||||
{ target: "_blank", href: "https://github.com/wakatime/chrome-wakatime/issues" },
|
||||
React.createElement("i", { className: "fa fa-fw fa-bug" }),
|
||||
"Report an Issue"
|
||||
)
|
||||
),
|
||||
React.createElement(
|
||||
"li",
|
||||
null,
|
||||
React.createElement(
|
||||
"a",
|
||||
{ target: "_blank", href: "https://github.com/wakatime/chrome-wakatime" },
|
||||
React.createElement("i", { className: "fa fa-fw fa-github" }),
|
||||
"View on GitHub"
|
||||
)
|
||||
"a",
|
||||
{ target: "_blank", href: "https://github.com/wakatime/chrome-wakatime" },
|
||||
React.createElement("i", { className: "fa fa-fw fa-github" }),
|
||||
"View on GitHub"
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
}]);
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
return Navbar;
|
||||
})(React.Component);
|
||||
|
||||
exports["default"] = Navbar;
|
||||
module.exports = exports["default"];
|
||||
|
||||
},{"react":183}],4:[function(require,module,exports){
|
||||
//jshint esnext:true
|
||||
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
|
||||
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
|
||||
module.exports = Navbar;
|
||||
|
||||
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; desc = parent = getter = undefined; _again = false; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; }
|
||||
},{"react":183}],4:[function(require,module,exports){
|
||||
'use strict';
|
||||
|
||||
var React = require('react');
|
||||
var $ = require('jquery');
|
||||
@@ -374,13 +308,11 @@ var WakaTimeOriginal = require('../core/WakaTime');
|
||||
// Helpers
|
||||
var changeExtensionState = require('../helpers/changeExtensionState');
|
||||
|
||||
var WakaTime = (function (_React$Component) {
|
||||
function WakaTime(props) {
|
||||
_classCallCheck(this, WakaTime);
|
||||
var WakaTime = React.createClass({
|
||||
displayName: 'WakaTime',
|
||||
|
||||
_get(Object.getPrototypeOf(WakaTime.prototype), 'constructor', this).call(this, props);
|
||||
|
||||
this.state = {
|
||||
getInitialState: function getInitialState() {
|
||||
return {
|
||||
user: {
|
||||
full_name: null,
|
||||
email: null,
|
||||
@@ -390,159 +322,150 @@ var WakaTime = (function (_React$Component) {
|
||||
loggingEnabled: config.loggingEnabled,
|
||||
totalTimeLoggedToday: '0 minutes'
|
||||
};
|
||||
}
|
||||
},
|
||||
|
||||
_inherits(WakaTime, _React$Component);
|
||||
componentDidMount: function componentDidMount() {
|
||||
|
||||
_createClass(WakaTime, [{
|
||||
key: 'componentDidMount',
|
||||
value: function componentDidMount() {
|
||||
var _this = this;
|
||||
var wakatime = new WakaTimeOriginal();
|
||||
|
||||
var wakatime = new WakaTimeOriginal();
|
||||
var that = this;
|
||||
|
||||
wakatime.checkAuth().done(function (data) {
|
||||
wakatime.checkAuth().done(function (data) {
|
||||
|
||||
if (data !== false) {
|
||||
if (data !== false) {
|
||||
|
||||
chrome.storage.sync.get({
|
||||
loggingEnabled: config.loggingEnabled
|
||||
}, function (items) {
|
||||
_this.setState({ loggingEnabled: items.loggingEnabled });
|
||||
if (items.loggingEnabled === true) {
|
||||
changeExtensionState('allGood');
|
||||
} else {
|
||||
changeExtensionState('notLogging');
|
||||
}
|
||||
});
|
||||
chrome.storage.sync.get({
|
||||
loggingEnabled: config.loggingEnabled
|
||||
}, function (items) {
|
||||
that.setState({ loggingEnabled: items.loggingEnabled });
|
||||
|
||||
_this.setState({
|
||||
user: {
|
||||
full_name: data.full_name,
|
||||
email: data.email,
|
||||
photo: data.photo
|
||||
},
|
||||
loggedIn: true
|
||||
});
|
||||
|
||||
wakatime.getTotalTimeLoggedToday().done(function (grand_total) {
|
||||
_this.setState({
|
||||
totalTimeLoggedToday: grand_total['text']
|
||||
});
|
||||
});
|
||||
} else {
|
||||
changeExtensionState('notSignedIn');
|
||||
}
|
||||
});
|
||||
}
|
||||
}, {
|
||||
key: 'logoutUser',
|
||||
value: function logoutUser() {
|
||||
var _this2 = this;
|
||||
|
||||
var deferredObject = $.Deferred();
|
||||
|
||||
$.ajax({
|
||||
url: config.logoutUserUrl,
|
||||
method: 'GET',
|
||||
success: function success() {
|
||||
|
||||
deferredObject.resolve(_this2);
|
||||
},
|
||||
error: function error(xhr, status, err) {
|
||||
|
||||
console.error(config.logoutUserUrl, status, err.toString());
|
||||
|
||||
deferredObject.resolve(_this2);
|
||||
}
|
||||
});
|
||||
|
||||
return deferredObject.promise();
|
||||
}
|
||||
}, {
|
||||
key: '_logoutUser',
|
||||
value: function _logoutUser() {
|
||||
var _this3 = this;
|
||||
|
||||
this.logoutUser().done(function () {
|
||||
|
||||
_this3.setState({
|
||||
user: {
|
||||
full_name: null,
|
||||
email: null,
|
||||
photo: null
|
||||
},
|
||||
loggedIn: false,
|
||||
loggingEnabled: false
|
||||
if (items.loggingEnabled === true) {
|
||||
changeExtensionState('allGood');
|
||||
} else {
|
||||
changeExtensionState('notLogging');
|
||||
}
|
||||
});
|
||||
|
||||
that.setState({
|
||||
user: {
|
||||
full_name: data.full_name,
|
||||
email: data.email,
|
||||
photo: data.photo
|
||||
},
|
||||
loggedIn: true
|
||||
});
|
||||
|
||||
wakatime.getTotalTimeLoggedToday().done(function (grand_total) {
|
||||
that.setState({
|
||||
totalTimeLoggedToday: grand_total['text']
|
||||
});
|
||||
});
|
||||
} else {
|
||||
changeExtensionState('notSignedIn');
|
||||
});
|
||||
}
|
||||
}, {
|
||||
key: '_disableLogging',
|
||||
value: function _disableLogging() {
|
||||
this.setState({
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
logoutUser: function logoutUser() {
|
||||
var deferredObject = $.Deferred();
|
||||
|
||||
var that = this;
|
||||
|
||||
$.ajax({
|
||||
url: config.logoutUserUrl,
|
||||
method: 'GET',
|
||||
success: function success() {
|
||||
|
||||
deferredObject.resolve(that);
|
||||
},
|
||||
error: function error(xhr, status, err) {
|
||||
|
||||
console.error(config.logoutUserUrl, status, err.toString());
|
||||
|
||||
deferredObject.resolve(that);
|
||||
}
|
||||
});
|
||||
|
||||
return deferredObject.promise();
|
||||
},
|
||||
|
||||
_logoutUser: function _logoutUser() {
|
||||
|
||||
var that = this;
|
||||
|
||||
this.logoutUser().done(function () {
|
||||
|
||||
that.setState({
|
||||
user: {
|
||||
full_name: null,
|
||||
email: null,
|
||||
photo: null
|
||||
},
|
||||
loggedIn: false,
|
||||
loggingEnabled: false
|
||||
});
|
||||
|
||||
changeExtensionState('notLogging');
|
||||
changeExtensionState('notSignedIn');
|
||||
});
|
||||
},
|
||||
|
||||
chrome.storage.sync.set({
|
||||
loggingEnabled: false
|
||||
});
|
||||
}
|
||||
}, {
|
||||
key: '_enableLogging',
|
||||
value: function _enableLogging() {
|
||||
this.setState({
|
||||
loggingEnabled: true
|
||||
});
|
||||
_disableLogging: function _disableLogging() {
|
||||
this.setState({
|
||||
loggingEnabled: false
|
||||
});
|
||||
|
||||
changeExtensionState('allGood');
|
||||
changeExtensionState('notLogging');
|
||||
|
||||
chrome.storage.sync.set({
|
||||
loggingEnabled: true
|
||||
});
|
||||
}
|
||||
}, {
|
||||
key: 'render',
|
||||
value: function render() {
|
||||
return React.createElement(
|
||||
chrome.storage.sync.set({
|
||||
loggingEnabled: false
|
||||
});
|
||||
},
|
||||
|
||||
_enableLogging: function _enableLogging() {
|
||||
this.setState({
|
||||
loggingEnabled: true
|
||||
});
|
||||
|
||||
changeExtensionState('allGood');
|
||||
|
||||
chrome.storage.sync.set({
|
||||
loggingEnabled: true
|
||||
});
|
||||
},
|
||||
|
||||
render: function render() {
|
||||
return React.createElement(
|
||||
'div',
|
||||
null,
|
||||
React.createElement(NavBar, {
|
||||
user: this.state.user,
|
||||
loggedIn: this.state.loggedIn }),
|
||||
React.createElement(
|
||||
'div',
|
||||
null,
|
||||
React.createElement(NavBar, {
|
||||
user: this.state.user,
|
||||
loggedIn: this.state.loggedIn }),
|
||||
{ className: 'container' },
|
||||
React.createElement(
|
||||
'div',
|
||||
{ className: 'container' },
|
||||
{ className: 'row' },
|
||||
React.createElement(
|
||||
'div',
|
||||
{ className: 'row' },
|
||||
React.createElement(
|
||||
'div',
|
||||
{ className: 'col-md-12' },
|
||||
React.createElement(MainList, {
|
||||
disableLogging: this._disableLogging.bind(this),
|
||||
enableLogging: this._enableLogging.bind(this),
|
||||
loggingEnabled: this.state.loggingEnabled,
|
||||
user: this.state.user,
|
||||
totalTimeLoggedToday: this.state.totalTimeLoggedToday,
|
||||
logoutUser: this._logoutUser.bind(this),
|
||||
loggedIn: this.state.loggedIn })
|
||||
)
|
||||
{ className: 'col-md-12' },
|
||||
React.createElement(MainList, {
|
||||
disableLogging: this._disableLogging,
|
||||
enableLogging: this._enableLogging,
|
||||
loggingEnabled: this.state.loggingEnabled,
|
||||
user: this.state.user,
|
||||
totalTimeLoggedToday: this.state.totalTimeLoggedToday,
|
||||
logoutUser: this._logoutUser,
|
||||
loggedIn: this.state.loggedIn })
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
}]);
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
return WakaTime;
|
||||
})(React.Component);
|
||||
});
|
||||
|
||||
exports['default'] = WakaTime;
|
||||
module.exports = exports['default'];
|
||||
module.exports = WakaTime;
|
||||
|
||||
},{"../config":5,"../core/WakaTime":6,"../helpers/changeExtensionState":8,"./MainList.react":2,"./NavBar.react":3,"jquery":26,"react":183}],5:[function(require,module,exports){
|
||||
'use strict';
|
||||
@@ -590,6 +513,7 @@ var config = {
|
||||
theme: 'light',
|
||||
// Valid extension states
|
||||
states: ['allGood', 'notLogging', 'notSignedIn', 'blacklisted', 'whitelisted'],
|
||||
// Predefined alert type and text for success and failure.
|
||||
alert: {
|
||||
success: {
|
||||
type: 'success',
|
||||
|
||||
@@ -142,6 +142,7 @@ var config = {
|
||||
theme: 'light',
|
||||
// Valid extension states
|
||||
states: ['allGood', 'notLogging', 'notSignedIn', 'blacklisted', 'whitelisted'],
|
||||
// Predefined alert type and text for success and failure.
|
||||
alert: {
|
||||
success: {
|
||||
type: 'success',
|
||||
|
||||
@@ -18,8 +18,6 @@ React.render(React.createElement(Options, null), document.getElementById('wakati
|
||||
'use strict';
|
||||
|
||||
var React = require('react');
|
||||
var ReactAddons = require('react/addons');
|
||||
var ReactCSSTransitionGroup = ReactAddons.addons.CSSTransitionGroup;
|
||||
var classNames = require('classnames');
|
||||
|
||||
var Alert = React.createClass({
|
||||
@@ -42,7 +40,7 @@ var Alert = React.createClass({
|
||||
|
||||
module.exports = Alert;
|
||||
|
||||
},{"classnames":18,"react":193,"react/addons":21}],3:[function(require,module,exports){
|
||||
},{"classnames":18,"react":193}],3:[function(require,module,exports){
|
||||
'use strict';
|
||||
|
||||
var React = require('react');
|
||||
@@ -407,6 +405,7 @@ var config = {
|
||||
theme: 'light',
|
||||
// Valid extension states
|
||||
states: ['allGood', 'notLogging', 'notSignedIn', 'blacklisted', 'whitelisted'],
|
||||
// Predefined alert type and text for success and failure.
|
||||
alert: {
|
||||
success: {
|
||||
type: 'success',
|
||||
|
||||
17
tests/components/Alert.react.jest.js
Normal file
17
tests/components/Alert.react.jest.js
Normal file
@@ -0,0 +1,17 @@
|
||||
jest.dontMock('../../assets/js/components/Alert.react.js');
|
||||
|
||||
describe('Wakatime', function() {
|
||||
var React, Alert, TestUtils, Component;
|
||||
|
||||
beforeEach(function() {
|
||||
// Setup our tools
|
||||
React = require('react/addons');
|
||||
Alert = require('../../assets/js/components/Alert.react.js');
|
||||
TestUtils = React.addons.TestUtils;
|
||||
// Create the React component here using TestUtils and store into Component
|
||||
});
|
||||
|
||||
it('should work', function() {
|
||||
expect(2 + 2).toEqual(4);
|
||||
});
|
||||
});
|
||||
17
tests/components/Options.react.jest.js
Normal file
17
tests/components/Options.react.jest.js
Normal file
@@ -0,0 +1,17 @@
|
||||
jest.dontMock('../../assets/js/components/Options.react.js');
|
||||
|
||||
describe('Wakatime', function() {
|
||||
var React, Options, TestUtils, Component;
|
||||
|
||||
beforeEach(function() {
|
||||
// Setup our tools
|
||||
React = require('react/addons');
|
||||
Options = require('../../assets/js/components/Options.react.js');
|
||||
TestUtils = React.addons.TestUtils;
|
||||
// Create the React component here using TestUtils and store into Component
|
||||
});
|
||||
|
||||
it('should work', function() {
|
||||
expect(2 + 2).toEqual(4);
|
||||
});
|
||||
});
|
||||
10
tests/helpers/changeExtensionState.spec.js
Normal file
10
tests/helpers/changeExtensionState.spec.js
Normal file
@@ -0,0 +1,10 @@
|
||||
var chai = require('chai');
|
||||
var expect = chai.expect;
|
||||
|
||||
import changeExtensionState from '../../assets/js/helpers/changeExtensionState';
|
||||
|
||||
describe('changeExtensionState', function() {
|
||||
it('should be a function', function() {
|
||||
expect(changeExtensionState).to.be.a('function');
|
||||
});
|
||||
});
|
||||
10
tests/helpers/changeExtensionTooltip.spec.js
Normal file
10
tests/helpers/changeExtensionTooltip.spec.js
Normal file
@@ -0,0 +1,10 @@
|
||||
var chai = require('chai');
|
||||
var expect = chai.expect;
|
||||
|
||||
import changeExtensionTooltip from '../../assets/js/helpers/changeExtensionTooltip';
|
||||
|
||||
describe('changeExtensionTooltip', function() {
|
||||
it('should be a function', function() {
|
||||
expect(changeExtensionTooltip).to.be.a('function');
|
||||
});
|
||||
});
|
||||
10
tests/helpers/getDomainFromUrl.spec.js
Normal file
10
tests/helpers/getDomainFromUrl.spec.js
Normal file
@@ -0,0 +1,10 @@
|
||||
var chai = require('chai');
|
||||
var expect = chai.expect;
|
||||
|
||||
import getDomainFromUrl from '../../assets/js/helpers/getDomainFromUrl';
|
||||
|
||||
describe('getDomainFromUrl', function() {
|
||||
it('should be a function', function() {
|
||||
expect(getDomainFromUrl).to.be.a('function');
|
||||
});
|
||||
});
|
||||
10
tests/helpers/in_array.spec.js
Normal file
10
tests/helpers/in_array.spec.js
Normal file
@@ -0,0 +1,10 @@
|
||||
var chai = require('chai');
|
||||
var expect = chai.expect;
|
||||
|
||||
import in_array from '../../assets/js/helpers/in_array';
|
||||
|
||||
describe('in_array', function() {
|
||||
it('should be a function', function() {
|
||||
expect(in_array).to.be.a('function');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user