diff --git a/.eslintrc.json b/.eslintrc.json index d99b2254b..94f1c933a 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -4,6 +4,16 @@ "node": true }, "extends": "eslint:recommended", + "ecmaFeatures": { + "sourceType": "module" + }, + "parserOptions": { + "sourceType": "module", + "ecmaFeatures": { + "jsx": true, + "experimentalObjectRestSpread": true + } + }, "rules": { "indent": ["error", 2 diff --git a/client/coral-admin/src/containers/ModerationQueue/ModerationQueue.js b/client/coral-admin/src/containers/ModerationQueue/ModerationQueue.js index a76652b18..b486ede6e 100644 --- a/client/coral-admin/src/containers/ModerationQueue/ModerationQueue.js +++ b/client/coral-admin/src/containers/ModerationQueue/ModerationQueue.js @@ -48,7 +48,6 @@ class ModerationQueue extends React.Component { // Hack for dynamic mdl tabs componentDidMount () { if (typeof componentHandler !== 'undefined') { - // FIXME: fix this hack componentHandler.upgradeAllRegistered(); // eslint-disable-line no-undef } @@ -56,7 +55,6 @@ class ModerationQueue extends React.Component { // Dispatch the update status action onCommentAction (action, id) { - // If not banning then change the status to approved or flagged as action = status this.props.dispatch(updateStatus(action, id)); } @@ -73,7 +71,7 @@ class ModerationQueue extends React.Component { this.props.dispatch(banUser('banned', userId, commentId)); } - showShortcuts = () => { + showShortcuts () { this.setState({modalOpen: true}); } @@ -100,7 +98,7 @@ class ModerationQueue extends React.Component { className={`mdl-tabs__tab ${styles.tab}`}>{lang.t('modqueue.rejected')} this.onTabClick('flagged')} className={`mdl-tabs__tab ${styles.tab}`}>{lang.t('modqueue.flagged')} - this.showShortcuts()} className={`mdl-tabs__tab ${styles.tab} ${styles.showShortcuts}`}> {lang.t('modqueue.showshortcuts')} @@ -122,7 +120,7 @@ class ModerationQueue extends React.Component { handleClose={() => this.hideBanUserDialog()} onClickBanUser={(userId, commentId) => this.banUser(userId, commentId)} user={comments.banUser}/> - +
-
- this.setState({modalOpen: false})} /> -
+ this.setState({modalOpen: false})} />
); - } } diff --git a/nightwatch.conf.js b/nightwatch.conf.js index a39ab128f..6823636c3 100644 --- a/nightwatch.conf.js +++ b/nightwatch.conf.js @@ -19,6 +19,8 @@ module.exports = { }, 'test_settings': { 'default': { + 'launch_url' : 'http://localhost:3000', + 'globals' : {}, 'selenium_port': 6666, 'selenium_host': 'localhost', 'silent': true, @@ -27,7 +29,7 @@ module.exports = { 'javascriptEnabled': true, 'acceptSslCerts': true, 'webStorageEnabled' : true, - 'databaseEnabled' : true, + 'databaseEnabled' : true,"" 'applicationCacheEnabled' : false, 'nativeEvents' : true }, @@ -37,8 +39,11 @@ module.exports = { 'on_error' : true, 'path' : './tests/e2e/reports' }, - 'exclude': [ - ] + 'exclude': [] + }, + 'integration': { + 'launch_url' : 'http://localhost:3000', + 'globals' : {} } } }; diff --git a/package.json b/package.json index 4ec24a27a..e7fc258c0 100644 --- a/package.json +++ b/package.json @@ -11,8 +11,8 @@ "lint-fix": "./node_modules/.bin/eslint bin/* . --fix", "test": "NODE_ENV=test ./node_modules/.bin/mocha --compilers js:babel-core/register tests/helpers/*.js --require ignore-styles --recursive tests", "test-watch": "NODE_ENV=test ./node_modules/.bin/mocha --compilers js:babel-core/register --recursive -w tests", - "pree2e": "NODE_ENV=test ./scripts/pree2e.sh", - "e2e": "NODE_ENV=test ./node_modules/.bin/nightwatch", + "pree2e": "node_modules/selenium-standalone/bin/selenium-standalone install", + "e2e": "NODE_ENV=test nightwatch", "embed-start": "NODE_ENV=development npm run build && ./bin/cli serve --jobs" }, "config": { @@ -115,7 +115,7 @@ "material-design-lite": "^1.2.1", "mocha": "^3.1.2", "mocha-junit-reporter": "^1.12.1", - "nightwatch": "^0.9.9", + "nightwatch": "^0.9.11", "node-fetch": "^1.6.3", "postcss-loader": "^1.1.0", "postcss-modules": "^0.5.2",