Ivan - Fix babel parser for test and make tests run [skip ci]

This commit is contained in:
ivan 2016-08-10 23:42:57 -03:00
parent ff9f37321f
commit 123c008636
14 changed files with 24 additions and 46 deletions

3
client/.babelrc Normal file
View File

@ -0,0 +1,3 @@
{
"optional": ["es7.classProperties"]
}

View File

@ -1,5 +0,0 @@
export default {
changeLanguage: stub(),
logged: stub(),
loggedOut: stub()
};

View File

@ -0,0 +1,3 @@
export default {
changeLanguage: stub()
};

View File

@ -0,0 +1,5 @@
export default {
login: stub(),
logout: stub(),
initSession: stub()
};

View File

@ -1,7 +0,0 @@
export default {
checkLoginStatus: stub(),
sendRecoverPassword: stub(),
recoverPassword: stub(),
login: stub(),
logout: stub()
};

View File

@ -0,0 +1,8 @@
export default {
dispatch: stub(),
getState: stub().returns({
config: {},
session: {},
routing: {}
})
};

View File

@ -1,7 +1,6 @@
const CommonStore = require('stores/__mocks__/common-store-mock');
const App = requireUnit('app/App', {
'store/common-store': CommonStore
});
describe('App component', function () {

View File

@ -1,9 +1,4 @@
const CommonActions = require('actions/__mocks__/common-actions-mock');
const UserStore = require('stores/__mocks__/user-store-mock');
const DashboardLayout = requireUnit('app/main/dashboard/dashboard-layout', {
'actions/common-actions': CommonActions,
'stores/user-store': UserStore,
'app/main/dashboard/dashboard-menu': ReactMock()
});

View File

@ -1,9 +1,6 @@
import React from 'react';
import {connect} from 'react-redux';
//import UserStore from 'stores/user-store';
//import CommonActions from 'actions/common-actions';
import DashboardMenu from 'app/main/dashboard/dashboard-menu';
const DashboardLayout = React.createClass({

View File

@ -1,6 +1,3 @@
const UserActions = require('actions/__mocks__/user-actions-mock');
const UserStore = require('stores/__mocks__/user-store-mock');
const SubmitButton = ReactMock();
const Button = ReactMock();
const Input = ReactMock();
@ -18,9 +15,7 @@ const MainHomePageLoginWidget = requireUnit('app/main/main-home/main-home-page-l
'core-components/checkbox': Checkbox,
'core-components/message': Message,
'core-components/widget': Widget,
'core-components/widget-transition': WidgetTransition,
'actions/user-actions': UserActions,
'stores/user-store': UserStore
'core-components/widget-transition': WidgetTransition
});

View File

@ -1,9 +1,4 @@
const CommonActions = require('actions/__mocks__/common-actions-mock');
const UserStore = require('stores/__mocks__/user-store-mock');
const MainHomePage = requireUnit('app/main/main-home/main-home-page', {
'actions/common-actions': CommonActions,
'stores/user-store': UserStore
});

View File

@ -1,7 +1,3 @@
const CommonActions = require('actions/__mocks__/common-actions-mock');
const UserActions = require('actions/__mocks__/user-actions-mock');
const UserStore = require('stores/__mocks__/user-store-mock');
const SubmitButton = ReactMock();
const Button = ReactMock();
const Input = ReactMock();
@ -15,10 +11,7 @@ const MainRecoverPasswordPage = requireUnit('app/main/main-recover-password/main
'core-components/input': Input,
'core-components/form': Form,
'core-components/message': Message,
'core-components/widget': Widget,
'actions/common-actions': CommonActions,
'actions/user-actions': UserActions,
'stores/user-store': UserStore
'core-components/widget': Widget
});
describe('Recover Password form', function () {

View File

@ -1,9 +1,4 @@
const CommonActions = require('actions/__mocks__/common-actions-mock');
const UserStore = require('stores/__mocks__/user-store-mock');
const MainSignupPage = requireUnit('app/main/main-signup/main-signup-page', {
'actions/common-actions': CommonActions,
'stores/user-store': UserStore,
'react-google-recaptcha': ReactMock()
});

View File

@ -1,3 +1,5 @@
'use strict';
var jsdom = require('jsdom').jsdom;
global.document = jsdom('<html><body></body></html>');