Cleaning url regex in commentstream.

This commit is contained in:
David Jay
2016-12-01 16:23:33 -05:00
parent d853b1f912
commit a118d263ea
7 changed files with 17 additions and 16 deletions
+2 -1
View File
@@ -17,7 +17,8 @@ const util = require('../util');
/**
* Get port from environment and store in Express.
*/
const port = normalizePort(process.env.TALK_PORT || '3000');
const port = normalizePort(process.env.TALK_PORT || (process.env.NODE_ENV === 'test' ? '3011' : '3000'));
app.set('port', port);
@@ -61,7 +61,7 @@ class CommentStream extends Component {
const path = /https?\:\/\/([^?#]+)/.exec(this.pym.parentUrl);
this.props.getStream(path || window.location);
this.props.getStream(path[1] || window.location);
this.path = path;
this.pym.sendMessage('childReady');
@@ -78,6 +78,7 @@ class CommentBox extends Component {
{ author && (
<Button
cStyle='darkGrey'
className={`${name}-button`}
onClick={this.postComment}>
{lang.t('post')}
</Button>
+2 -2
View File
@@ -11,8 +11,8 @@
"lint-fix": "eslint . --fix",
"test": "NODE_ENV=test mocha --compilers js:babel-core/register --recursive tests",
"test-watch": "NODE_ENV=test mocha --compilers js:babel-core/register --recursive -w tests",
"pree2e": "./pree2e.sh",
"e2e": "source .env-test && node_modules/.bin/nightwatch",
"pree2e": "NODE_ENV=test ./pree2e.sh",
"e2e": "NODE_ENV=test node_modules/.bin/nightwatch",
"embed-start": "NODE_ENV=development npm run build && ./bin/cli serve --jobs"
},
"config": {
-1
View File
@@ -1,3 +1,2 @@
node_modules/selenium-standalone/bin/selenium-standalone install
source .env-test
npm start &
+1 -1
View File
@@ -1,4 +1,4 @@
module.exports = {
waitForConditionTimeout: 20000,
baseUrl: 'http://localhost:3011'
baseUrl: 'localhost:3011/'
};
+10 -10
View File
@@ -37,11 +37,11 @@ module.exports = {
.click('#coralSignUpButton')
.waitForElementVisible('#coralLogInButton', 10000)
.click('#coralLogInButton')
.waitForElementVisible('#commentBox .coral-plugin-commentbox-button', 3000)
.waitForElementVisible('.coral-plugin-commentbox-button', 4000)
// Post a comment
.setValue('#commentBox .coral-plugin-commentbox-textarea', mockComment)
.click('#commentBox .coral-plugin-commentbox-button')
.setValue('.coral-plugin-commentbox-textarea', mockComment)
.click('.coral-plugin-commentbox-button')
.waitForElementVisible('.comment', 1000)
//Verify that it appears
@@ -63,9 +63,9 @@ module.exports = {
.frame('coralStreamIframe');
// Post a comment
client.waitForElementVisible('#commentBox .coral-plugin-commentbox-button', 2000)
.setValue('#commentBox .coral-plugin-commentbox-textarea', mockComment)
.click('#commentBox .coral-plugin-commentbox-button')
client.waitForElementVisible('.coral-plugin-commentbox-button', 2000)
.setValue('.coral-plugin-commentbox-textarea', mockComment)
.click('.coral-plugin-commentbox-button')
.waitForElementVisible('#coral-notif', 1000)
//Verify that it appears
@@ -88,9 +88,9 @@ module.exports = {
.frame('coralStreamIframe');
// Post a comment
client.waitForElementVisible('#commentBox .coral-plugin-commentbox-button', 2000)
.setValue('#commentBox .coral-plugin-commentbox-textarea', mockComment)
.click('#commentBox .coral-plugin-commentbox-button')
client.waitForElementVisible('.coral-plugin-commentbox-button', 2000)
.setValue('.coral-plugin-commentbox-textarea', mockComment)
.click('.coral-plugin-commentbox-button')
// Post a reply
.waitForElementVisible('.coral-plugin-replies-reply-button', 5000)
@@ -162,7 +162,7 @@ module.exports = {
// Verify that comment count is correct
client.waitForElementVisible('.coral-plugin-comment-count-text', 2000)
.assert.containsText('.coral-plugin-comment-count-text', '5 Comments');
.assert.containsText('.coral-plugin-comment-count-text', '1 Comment');
done();
});
},