mirror of
https://github.com/wassname/talk.git
synced 2026-08-12 12:30:39 +08:00
Commenter likes a comment
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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'
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user