Commenter likes a comment

This commit is contained in:
Belen Curcio
2016-12-18 19:34:41 -03:00
parent f52a1668b0
commit 9950595245
3 changed files with 32 additions and 15 deletions
+1 -1
View File
@@ -2,7 +2,7 @@ import React from 'react';
import {I18n} from '../coral-framework';
import translations from './translations.json';
const name = 'coral-plugin-flags';
const name = 'coral-plugin-likes';
const LikeButton = ({like, id, postAction, deleteAction, addItem, showSignInDialog, updateItem, currentUser, banned}) => {
const liked = like && like.current_user;
+8
View File
@@ -33,6 +33,11 @@ const embedStreamCommands = {
.waitForElementVisible('@commentBox', 2000)
.setValue('@commentBox', comment)
.click('@postButton');
},
likeComment() {
return this
.waitForElementVisible('@likeButton', 2000)
.click('@likeButton');
}
};
@@ -62,6 +67,9 @@ export default {
},
postButton: {
selector: '#commentBox .coral-plugin-commentbox-button'
},
likeButton: {
selector: '.comment:first-child .coral-plugin-likes-button'
}
}
};
+23 -14
View File
@@ -1,15 +1,24 @@
// Given I am signed into my commenter account
// And I am on the comment stream page
// And I see the option to like a comment
// And I see the number of likes on a comment
// When I like a comment
// Then the comment should show as Liked
// And the like count should increase by one
module.exports = {
'@tags': ['like', 'comments', 'commenter'],
before: client => {
const embedStreamPage = client.page.embedStreamPage();
const {users} = client.globals;
// Given I am a visitor and not logged in
// And I am on the comment stream page
// And I see the option to like a comment
// And I see the number of likes on a comment
// When I like a comment
// Then I should be prompted to login to like a comment
// And the like count should not be increased
embedStreamPage
.navigate()
.ready();
embedStreamPage
.login(users.commenter);
},
'Commenter likes a comment': client => {
const embedStreamPage = client.page.embedStreamPage();
embedStreamPage
.likeComment();
},
after: client => {
client.end();
}
};