diff --git a/client/coral-admin/src/components/Comment.js b/client/coral-admin/src/components/Comment.js index 4a21b0846..84c0e0541 100644 --- a/client/coral-admin/src/components/Comment.js +++ b/client/coral-admin/src/components/Comment.js @@ -30,7 +30,7 @@ export default props => {
{links ? Contains Link : null} -
+
{props.actions.map((action, i) => getActionButton(action, i, props))}
@@ -63,19 +63,21 @@ const getActionButton = (action, i, props) => { if (action === 'ban') { return ( ); } return ( props.onClickAction(props.actionsMap[action].status, comment.id)} /> diff --git a/client/coral-admin/src/components/CommentList.js b/client/coral-admin/src/components/CommentList.js index 597ea62a6..39de5121b 100644 --- a/client/coral-admin/src/components/CommentList.js +++ b/client/coral-admin/src/components/CommentList.js @@ -126,7 +126,10 @@ export default class CommentList extends React.Component { const {active} = this.state; return ( -
); diff --git a/client/coral-sign-in/components/styles.css b/client/coral-sign-in/components/styles.css index 2bec52b45..f1a7bace3 100644 --- a/client/coral-sign-in/components/styles.css +++ b/client/coral-sign-in/components/styles.css @@ -113,6 +113,7 @@ input.error{ font-weight: bold; cursor: pointer; margin: 0px; + margin-left: 4px; padding-bottom: 2px; border-bottom: solid 1px black; } diff --git a/tests/e2e/pages/adminPage.js b/tests/e2e/pages/adminPage.js new file mode 100644 index 000000000..8aad77b55 --- /dev/null +++ b/tests/e2e/pages/adminPage.js @@ -0,0 +1,34 @@ +const embedStreamCommands = { + url: function () { + return this + .api.launchUrl + '/admin'; + }, + ready() { + return this + .waitForElementVisible('body', 2000); + }, + approveComment() { + return this + .waitForElementVisible('@commentList') + .waitForElementVisible('@approveButton') + .click('@approveButton'); + } +}; + +export default { + commands: [embedStreamCommands], + elements: { + commentList: { + selector: '#commentList' + }, + banButton: { + selector: '#commentList .actions:first-child .ban' + }, + rejectButton: { + selector: '#commentList .actions:first-child .reject' + }, + approveButton: { + selector: '#commentList .actions:first-child .approve' + } + } +}; diff --git a/tests/e2e/pages/embedStreamPage.js b/tests/e2e/pages/embedStreamPage.js index 3c1671d2a..67798036e 100644 --- a/tests/e2e/pages/embedStreamPage.js +++ b/tests/e2e/pages/embedStreamPage.js @@ -19,7 +19,14 @@ const embedStreamCommands = { .setValue('@signInDialogEmail', user.email) .setValue('@signInDialogPassword', user.pass) .waitForElementVisible('@logInButton') - .click('@logInButton'); + .click('@logInButton') + .waitForElementVisible('@logoutButton', 5000); + }, + logout() { + return this + .waitForElementVisible('@logoutButton') + .click('@logoutButton') + .waitForElementVisible('@signInButton', 2000); }, postComment(comment = 'Test Comment') { return this @@ -47,6 +54,9 @@ export default { logInButton: { selector: '#coralLogInButton' }, + logoutButton: { + selector: '.commentStream #logout' + }, commentBox: { selector: '.coral-plugin-commentbox-textarea' }, diff --git a/tests/e2e/tests/Commenter/PostComment.js b/tests/e2e/tests/Commenter/PostComment.js index 3e4bd91a6..91e28415d 100644 --- a/tests/e2e/tests/Commenter/PostComment.js +++ b/tests/e2e/tests/Commenter/PostComment.js @@ -18,6 +18,21 @@ module.exports = { .postComment('I read the comments'); }, after: client => { + const adminPage = client.page.adminPage(); + const embedStreamPage = client.page.embedStreamPage(); + const {users} = client.globals; + + embedStreamPage + .logout() + .login(users.admin); + + adminPage + .navigate() + .ready(); + + adminPage + .approveComment(); + client.end(); } };