From bd1a0a123df9f6edf114d00271521f24aa5a2672 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Espino=20Garc=C3=ADa?= Date: Fri, 10 May 2024 09:20:30 +0200 Subject: [PATCH] Fix test for invite modal error (#26948) * Fix test for invite modal error * Update copy in tests * Update copy --- .../guest_accounts/guest_invitation_ui_more_spec.ts | 4 ++-- .../guest_accounts/guest_invitation_ui_spec.ts | 2 +- webapp/channels/src/actions/invite_actions.test.ts | 12 ++++++------ webapp/channels/src/actions/invite_actions.ts | 2 +- webapp/channels/src/i18n/en.json | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/e2e-tests/cypress/tests/integration/channels/enterprise/guest_accounts/guest_invitation_ui_more_spec.ts b/e2e-tests/cypress/tests/integration/channels/enterprise/guest_accounts/guest_invitation_ui_more_spec.ts index 3782836229..069bd3be63 100644 --- a/e2e-tests/cypress/tests/integration/channels/enterprise/guest_accounts/guest_invitation_ui_more_spec.ts +++ b/e2e-tests/cypress/tests/integration/channels/enterprise/guest_accounts/guest_invitation_ui_more_spec.ts @@ -54,7 +54,7 @@ describe('Guest Account - Guest User Invitation Flow', () => { invitePeople(newUser.username, 1, newUser.username); // * Verify the content and message in next screen - verifyInvitationError(newUser.username, testTeam, 'This person is already a member.'); + verifyInvitationError(newUser.username, testTeam, 'This person is already a member of the workspace. Invite them as a member instead of a guest.'); }); }); }); @@ -83,7 +83,7 @@ describe('Guest Account - Guest User Invitation Flow', () => { invitePeople(regularUser.email, 1, regularUser.username); // * Verify the content and message in next screen - verifyInvitationError(regularUser.username, testTeam, 'This person is already a member.'); + verifyInvitationError(regularUser.username, testTeam, 'This person is already a member of the workspace. Invite them as a member instead of a guest.'); }); }); diff --git a/e2e-tests/cypress/tests/integration/channels/enterprise/guest_accounts/guest_invitation_ui_spec.ts b/e2e-tests/cypress/tests/integration/channels/enterprise/guest_accounts/guest_invitation_ui_spec.ts index a1acc16f2e..1e3222cc59 100644 --- a/e2e-tests/cypress/tests/integration/channels/enterprise/guest_accounts/guest_invitation_ui_spec.ts +++ b/e2e-tests/cypress/tests/integration/channels/enterprise/guest_accounts/guest_invitation_ui_spec.ts @@ -198,7 +198,7 @@ describe('Guest Account - Guest User Invitation Flow', () => { invitePeople(newUser.username, 1, newUser.username); // * Verify the content and message in next screen - cy.findByText('This person is already a member.').should('be.visible'); + cy.findByText('This person is already a member of the workspace. Invite them as a member instead of a guest.').should('be.visible'); // # Click on invite more button cy.findByTestId('invite-more').click(); diff --git a/webapp/channels/src/actions/invite_actions.test.ts b/webapp/channels/src/actions/invite_actions.test.ts index 4e6d8d4d98..b104609bc8 100644 --- a/webapp/channels/src/actions/invite_actions.test.ts +++ b/webapp/channels/src/actions/invite_actions.test.ts @@ -401,14 +401,14 @@ describe('actions/invite_actions', () => { ], notSent: [ { - reason: 'This person is already a member.', + reason: 'This person is already a member of the workspace. Invite them as a member instead of a guest.', user: { id: 'user1', roles: 'system_user', }, }, { - reason: 'This person is already a member.', + reason: 'This person is already a member of the workspace. Invite them as a member instead of a guest.', user: { id: 'other-user', roles: 'system_user', @@ -489,14 +489,14 @@ describe('actions/invite_actions', () => { ], notSent: [ { - reason: 'This person is already a member.', + reason: 'This person is already a member of the workspace. Invite them as a member instead of a guest.', user: { id: 'user1', roles: 'system_user', }, }, { - reason: 'This person is already a member.', + reason: 'This person is already a member of the workspace. Invite them as a member instead of a guest.', user: { id: 'other-user', roles: 'system_user', @@ -520,7 +520,7 @@ describe('actions/invite_actions', () => { sent: [], notSent: [ { - reason: 'This person is already a member.', + reason: 'This person is already a member of the workspace. Invite them as a member instead of a guest.', user: { id: 'user1', roles: 'system_user', @@ -534,7 +534,7 @@ describe('actions/invite_actions', () => { }, }, { - reason: 'This person is already a member.', + reason: 'This person is already a member of the workspace. Invite them as a member instead of a guest.', user: { id: 'other-user', roles: 'system_user', diff --git a/webapp/channels/src/actions/invite_actions.ts b/webapp/channels/src/actions/invite_actions.ts index 631c65975f..d9468444f3 100644 --- a/webapp/channels/src/actions/invite_actions.ts +++ b/webapp/channels/src/actions/invite_actions.ts @@ -116,7 +116,7 @@ export async function sendGuestInviteForUser( members: RelationOneToOne>, ) { if (!isGuest(user.roles)) { - return {notSent: {user, reason: localizeMessage('invite.members.user-is-not-guest', 'This person is already a member.')}}; + return {notSent: {user, reason: localizeMessage('invite.members.user-is-not-guest', 'This person is already a member of the workspace. Invite them as a member instead of a guest.')}}; } let memberOfAll = true; let memberOfAny = false; diff --git a/webapp/channels/src/i18n/en.json b/webapp/channels/src/i18n/en.json index 9510ddd4a9..671eb32382 100644 --- a/webapp/channels/src/i18n/en.json +++ b/webapp/channels/src/i18n/en.json @@ -3959,7 +3959,7 @@ "invite.members.invite-sent": "An invitation email has been sent.", "invite.members.unable-to-add-the-user-to-the-team": "Unable to add the user to the team.", "invite.members.user-is-guest": "Contact your admin to make this guest a full member.", - "invite.members.user-is-not-guest": "This person is already a member.", + "invite.members.user-is-not-guest": "This person is already a member of the workspace. Invite them as a member instead of a guest.", "invite.rate-limit-exceeded": "Invite emails rate limit exceeded.", "join_team_group_constrained_denied": "You need to be a member of a linked group to join this team.", "join_team_group_constrained_denied_admin": "You need to be a member of a linked group to join this team. You can add a group to this team [here]({siteURL}/admin_console/user_management/groups).",