Addressing errors with replies in e2e.

This commit is contained in:
David Jay
2017-01-27 17:29:23 -05:00
parent 1da61784b4
commit b674ff45c0
5 changed files with 19 additions and 24 deletions
+16 -20
View File
@@ -1,7 +1,7 @@
const mongoose = require('../../helpers/mongoose');
const mocks = require('../mocks');
const mockComment = 'This is a test comment.';
const mockComment = 'I read the comments';
const mockReply = 'This is a test reply';
const mockUser = {
email: `${new Date().getTime()}@test.com`,
@@ -46,10 +46,10 @@ module.exports = {
// Post a comment
.setValue('.coral-plugin-commentbox-textarea', mockComment)
.click('.coral-plugin-commentbox-button')
.waitForElementVisible('.comment', 1000)
.waitForElementVisible('.coral-plugin-content-text', 1000)
// Verify that it appears
.assert.containsText('.comment', mockComment);
.assert.containsText('.coral-plugin-content-text', mockComment);
done();
})
.catch((err) => {
@@ -103,8 +103,8 @@ module.exports = {
.click('.coral-plugin-replies-reply-button')
.waitForElementVisible('#replyText')
.setValue('#replyText', mockReply)
.click('.coral-plugin-replies-textarea button')
.waitForElementVisible('.reply', 2000)
.click('.coral-plugin-replies-textarea .coral-plugin-commentbox-button')
.waitForElementVisible('.reply', 20000)
// Verify that it appears
.assert.containsText('.reply', mockReply);
@@ -121,22 +121,18 @@ module.exports = {
mocks.settings({moderation: 'PRE'})
// Add a mock user
.then(() => {
return mocks.users([{
displayName: 'Baby Blue',
email: 'whale@tale.sea',
password: 'krill'
}]);
})
.then(() => mocks.users([{
displayName: 'Baby Blue',
email: 'whale@tale.sea',
password: 'krill'
}]))
// Add a mock preapproved comment by that user
.then((user) => {
return mocks.comments([{
body: 'Whales are not fish.',
status: 'accepted',
author_id: user.id
}]);
})
.then((user) => mocks.comments([{
body: 'Whales are not fish.',
status: 'accepted',
author_id: user.id
}]))
.then(() => {
// Load Page
@@ -169,7 +165,7 @@ module.exports = {
// Verify that comment count is correct
client.waitForElementVisible('.coral-plugin-comment-count-text', 2000)
.assert.containsText('.coral-plugin-comment-count-text', '2 Comments');
.assert.containsText('.coral-plugin-comment-count-text', '4 Comments');
done();
});
},