Merge branch 'reply' of github.com:coralproject/talk into reply

* 'reply' of github.com:coralproject/talk: (193 commits)
  Add some margin to loadmore
  typo
  updated tests
  updated tests
  Fully implement SetUsername
  removed snakecase
  fix to optional required param
  Use correct mutation and show errors
  refactored mailer service with lodash!
  Fix live status updates
  Move ChangeUsername to the appropiate tab
  Fix change username not displaying errors
  Remove defunct refetch detection workaround
  Rename UnBan and UnSuspend
  hardened configuration
  user cli patches
  don't apply configuration from dotfiles during testing
  applied rename to graph mutation edges
  reintroduced the errors.ErrSameUsernameProvided
  fixed wrong query logic
  ...
This commit is contained in:
okbel
2018-01-10 14:08:58 -03:00
221 changed files with 7193 additions and 4100 deletions
+41 -13
View File
@@ -54,24 +54,34 @@ module.exports = {
moderateNav: '.talk-admin-nav-moderate',
settingsButton: '.talk-admin-header-settings-button',
signOutButton: '.talk-admin-header-sign-out',
suspendUserDialog: '.talk-admin-suspend-user-dialog',
suspendUserConfirmButton: '.talk-admin-suspend-user-dialog-confirm',
supendUserSendButton: '.talk-admin-suspend-user-dialog-send',
usernameDialog: '.talk-reject-username-dialog',
usernameDialogButtons: '.talk-reject-username-dialog-buttons',
usernameDialogSuspend: '.talk-reject-username-dialog-button-k',
usernameDialogSuspensionMessage: '.talk-reject-username-dialog-suspension-message',
toast: '.toastify',
toastClose: '.toastify__close',
},
sections: {
suspendUserDialog: {
selector: '.talk-admin-suspend-user-dialog',
elements: {
step0: '.talk-admin-suspend-user-dialog-step-0',
step1: '.talk-admin-suspend-user-dialog-step-1',
confirmButton: '.talk-admin-suspend-user-dialog-confirm',
sendButton: '.talk-admin-suspend-user-dialog-send',
}
},
usernameDialog: {
selector: '.talk-admin-reject-username-dialog',
elements: {
step0: '.talk-admin-reject-username-dialog-step-0',
step1: '.talk-admin-reject-username-dialog-step-1',
buttons: '.talk-admin-reject-username-dialog-buttons',
suspend: '.talk-admin-reject-username-dialog-button-k',
suspensionMessage: '.talk-admin-reject-username-dialog-suspension-message',
}
},
moderate: {
selector: '.talk-admin-moderation-container',
elements: {
comment: '.talk-admin-moderate-comment',
commentActionMenu: '.talk-admin-moderate-comment-actions-menu',
actionItemSuspendUser: '.action-menu-item#suspendUser',
actionMenuButton: '.talk-admin-moderate-comment-actions-menu #actions-dropdown-0'
commentUsername: '.talk-admin-moderate-comment-username',
}
},
stories: {
@@ -109,13 +119,31 @@ module.exports = {
firstRow: '.talk-admin-community-people-row:first-child',
dropdownStatus: '.talk-admin-community-people-dd-status',
dropdownRole: '.talk-admin-community-people-dd-role',
dropdownStatusActive: '.talk-admin-community-people-dd-status .dd-list-active',
optionActive: '.dd-option#ACTIVE',
optionBanned: '.dd-option#BANNED',
dropdownStatusActive: '.talk-admin-community-people-dd-status .is-upgraded',
optionSuspendUser: '.action-menu-item#suspendUser',
optionBanUser: '.action-menu-item#banUser',
optionRemoveBan: '.action-menu-item#removeBan',
optionRemoveSuspension: '.action-menu-item#removeSuspension',
}
}
}
},
userDetailDrawer: {
selector: '.talk-admin-user-detail-drawer',
elements: {
'closeButton': '.talk-admin-user-detail-drawer-close-button',
'tabBar': '.talk-admin-user-detail-tab-bar',
'allTab': '.talk-admin-user-detail-all-tab',
'rejectedTab': '.talk-admin-user-detail-rejected-tab',
'historyTab': '.talk-admin-user-detail-history-tab',
'historyPane': '.talk-admin-user-detail-history-tab-pane',
'accountHistory': '.talk-admin-account-history',
'accountHistoryRowStatus':'.talk-admin-account-history-row-status',
'actionsMenu': '.talk-admin-user-detail-actions-button',
'actionItemSuspendUser': '.action-menu-item#suspendUser',
'actionMenuButton': '.talk-admin-user-detail-actions-menu #actions-dropdown-0',
}
},
drawer: {
selector: '.talk-admin-drawer-nav',
commands: [{
+2 -2
View File
@@ -105,8 +105,8 @@ module.exports = {
replyButton: '.talk-stream-comment.talk-stream-comment-level-0 .talk-plugin-replies-reply-button',
respectButton: '.talk-stream-comment.talk-stream-comment-level-0 .talk-stream-comment-footer .talk-plugin-respect-button',
restrictedMessageBox: '.talk-restricted-message-box',
suspendedAccountInput: '.talk-suspended-account-username-input',
suspendedAccountSubmitButton: '.talk-suspended-account-submit-button',
changeUsernameInput: '.talk-change-username-username-input',
changeUsernameSubmitButton: '.talk-change-username-submit-button',
},
sections: {
flag: {
+2 -1
View File
@@ -37,6 +37,7 @@ module.exports = {
adminPage
.openDrawer()
.goToCommunity();
.goToCommunity();
},
};
+1
View File
@@ -18,6 +18,7 @@ module.exports = {
},
'creates a new asset': (client) => {
const asset = 'newAssetTest';
const embedStream = client.page.embedStream();
+18 -20
View File
@@ -22,12 +22,10 @@ module.exports = {
adminPage.navigateAndLogin(admin);
},
'admin flags user\'s username as offensive': (client) => {
'admin flags users username as offensive': (client) => {
const embedStream = client.page.embedStream();
const comments = embedStream
.navigate()
.ready();
const comments = embedStream.navigate().ready();
comments
.waitForElementVisible('@firstComment')
@@ -65,17 +63,18 @@ module.exports = {
.click('@flaggedUserRejectButton');
},
'admin suspends the user': (client) => {
const adminPage = client.page.admin();
const community = client.page.admin().section.community;
const usernameDialog = client.page.admin().section.usernameDialog;
adminPage
.waitForElementVisible('@usernameDialog')
.waitForElementVisible('@usernameDialogButtons')
.waitForElementVisible('@usernameDialogSuspend')
.click('@usernameDialogSuspend')
.waitForElementVisible('@usernameDialogSuspensionMessage')
.click('@usernameDialogSuspend');
usernameDialog
.waitForElementVisible('@buttons')
.waitForElementVisible('@step0')
.waitForElementVisible('@suspend')
.click('@suspend')
.waitForElementVisible('@step1')
.waitForElementVisible('@suspend')
.click('@suspend');
community
.waitForElementNotPresent('@flaggedUser');
},
@@ -95,8 +94,7 @@ module.exports = {
const embedStream = client.page.embedStream();
const comments = embedStream.section.comments;
comments
.waitForElementVisible('@restrictedMessageBox');
comments.waitForElementVisible('@restrictedMessageBox');
},
'user should not be able to comment': (client) => {
const embedStream = client.page.embedStream();
@@ -112,11 +110,11 @@ module.exports = {
const {testData: {user}} = client.globals;
comments
.waitForElementVisible('@suspendedAccountInput')
.setValue('@suspendedAccountInput', `${user.username}_alternative`)
.waitForElementVisible('@suspendedAccountSubmitButton')
.click('@suspendedAccountSubmitButton')
.waitForElementNotPresent('@suspendedAccountInput');
.waitForElementVisible('@changeUsernameInput')
.setValue('@changeUsernameInput', `${user.username}_alternative`)
.waitForElementVisible('@changeUsernameSubmitButton')
.click('@changeUsernameSubmitButton')
.waitForElementNotPresent('@changeUsernameInput');
},
'user should be able to comment': (client) => {
const embedStream = client.page.embedStream();
+2 -2
View File
@@ -84,7 +84,7 @@ module.exports = {
adminPage
.goToCommunity()
.goToPeople();
.goToPeople();
},
'admin removes ban from user': (client) => {
const people = client.page.admin()
@@ -96,7 +96,7 @@ module.exports = {
.waitForElementVisible('@dropdownStatus')
.click('@dropdownStatus')
.waitForElementVisible('@dropdownStatusActive')
.click('@optionActive');
.click('@optionRemoveBan');
},
'admin logs out 2': (client) => {
client.page.admin().logout();
+34 -9
View File
@@ -83,7 +83,7 @@ module.exports = {
},
'admin suspends user': (client) => {
const adminPage = client.page.admin();
const moderate = adminPage.section.moderate;
const {moderate, userDetailDrawer, suspendUserDialog} = adminPage.section;
adminPage
.navigate()
@@ -92,18 +92,22 @@ module.exports = {
moderate
.waitForElementVisible('@comment')
.waitForElementVisible('@commentActionMenu')
.waitForElementVisible('@actionMenuButton')
.waitForElementVisible('@commentUsername')
.click('@commentUsername');
userDetailDrawer
.waitForElementVisible('@actionsMenu')
.click('@actionMenuButton')
.waitForElementVisible('@actionItemSuspendUser')
.click('@actionItemSuspendUser');
adminPage
.waitForElementVisible('@suspendUserDialog')
.waitForElementVisible('@suspendUserConfirmButton')
.click('@suspendUserConfirmButton')
.waitForElementVisible('@supendUserSendButton')
.click('@supendUserSendButton');
suspendUserDialog
.waitForElementVisible('@step0')
.waitForElementVisible('@confirmButton')
.click('@confirmButton')
.waitForElementVisible('@step1')
.waitForElementVisible('@sendButton')
.click('@sendButton');
adminPage
.waitForElementVisible('@toast')
@@ -111,6 +115,27 @@ module.exports = {
.click('@toastClose');
},
'admin checks user status and ban and suspension history': (client) => {
const adminPage = client.page.admin();
const {moderate, userDetailDrawer} = adminPage.section;
moderate
.waitForElementVisible('@comment')
.waitForElementVisible('@commentUsername')
.click('@commentUsername');
userDetailDrawer
.waitForElementVisible('@tabBar')
.waitForElementVisible('@allTab')
.click('@allTab')
.waitForElementVisible('@rejectedTab')
.click('@rejectedTab')
.waitForElementVisible('@historyTab')
.click('@historyTab')
.waitForElementVisible('@historyPane')
.waitForElementVisible('@accountHistory')
.click('@closeButton');
},
'admin logs out': (client) => {
const adminPage = client.page.admin();