diff --git a/e2e-tests/cypress/tests/integration/channels/team_settings/closed_team_invite_by_email_spec.js b/e2e-tests/cypress/tests/integration/channels/team_settings/closed_team_invite_by_email_spec.js index 2e1c148b05..f42dd3ccc7 100644 --- a/e2e-tests/cypress/tests/integration/channels/team_settings/closed_team_invite_by_email_spec.js +++ b/e2e-tests/cypress/tests/integration/channels/team_settings/closed_team_invite_by_email_spec.js @@ -59,13 +59,16 @@ describe('Team Settings', () => { // * Check that the 'Team Settings' modal was opened cy.get('#teamSettingsModal').should('exist').within(() => { - cy.get('#open_inviteDesc').should('have.text', 'No'); + // # Go to Access section + cy.get('#accessButton').click(); - // # Click on the 'Allow only users with a specific email domain to join this team' edit button - cy.get('#allowed_domainsEdit').should('be.visible').click(); + cy.get('.access-allowed-domains-section').should('exist').within(() => { + // # Click on the 'Allow only users with a specific email domain to join this team' checkbox + cy.get('.mm-modal-generic-section-item__input-checkbox').should('not.be.checked').click(); + }); // * Verify that the '#allowedDomains' input field is empty - cy.get('#allowedDomains').should('be.empty'); + cy.get('#allowedDomains').should('have.text', 'corp.mattermost.com, mattermost.com'); // # Close the modal cy.get('#teamSettingsModalLabel').find('button').should('be.visible').click(); diff --git a/e2e-tests/cypress/tests/integration/channels/team_settings/invite_user_to_closed_team_spec.js b/e2e-tests/cypress/tests/integration/channels/team_settings/invite_user_to_closed_team_spec.js index 19cbc1ceff..d9577a58d8 100644 --- a/e2e-tests/cypress/tests/integration/channels/team_settings/invite_user_to_closed_team_spec.js +++ b/e2e-tests/cypress/tests/integration/channels/team_settings/invite_user_to_closed_team_spec.js @@ -38,12 +38,16 @@ describe('Team Settings', () => { // * Check that the 'Team Settings' modal was opened cy.get('#teamSettingsModal').should('exist').within(() => { - // # Click on the 'Allow only users with a specific email domain to join this team' edit button - cy.get('#allowed_domainsEdit').should('be.visible').click(); + // # Go to Access section + cy.get('#accessButton').click(); + + cy.get('.access-allowed-domains-section').should('exist').within(() => { + // # Click on the 'Allow only users with a specific email domain to join this team' checkbox + cy.get('.mm-modal-generic-section-item__input-checkbox').should('not.be.checked').click(); + }); // # Set 'sample.mattermost.com' as the only allowed email domain and save - cy.wait(TIMEOUTS.HALF_SEC); - cy.focused().type(emailDomain); + cy.get('#allowedDomains').click().type(emailDomain).type(' '); cy.findByText('Save').should('be.visible').click(); // # Close the modal diff --git a/e2e-tests/cypress/tests/integration/channels/team_settings/join_closed_team_with_not_allowed_email_spec.js b/e2e-tests/cypress/tests/integration/channels/team_settings/join_closed_team_with_not_allowed_email_spec.js index 3753e85dee..894f7daf1e 100644 --- a/e2e-tests/cypress/tests/integration/channels/team_settings/join_closed_team_with_not_allowed_email_spec.js +++ b/e2e-tests/cypress/tests/integration/channels/team_settings/join_closed_team_with_not_allowed_email_spec.js @@ -11,7 +11,6 @@ // Group: @channels @team_settings import {getRandomId, stubClipboard} from '../../../utils'; -import * as TIMEOUTS from '../../../fixtures/timeouts'; describe('Team Settings', () => { const randomId = getRandomId(); @@ -47,15 +46,22 @@ describe('Team Settings', () => { // * Check that the 'Team Settings' modal was opened cy.get('#teamSettingsModal').should('exist').within(() => { - // # Click on the 'Allow only users with a specific email domain to join this team' edit button - cy.get('#allowed_domainsEdit').should('be.visible').click(); + // # Go to Access section + cy.get('#accessButton').click(); - // # Set 'sample.mattermost.com' as the only allowed email domain, save then close - cy.wait(TIMEOUTS.HALF_SEC); - cy.focused().type(emailDomain); - cy.uiSaveAndClose(); + // # Click on the 'Allow only users with a specific email domain to join this team' edit button + cy.get('.access-allowed-domains-section').should('exist').within(() => { + // # Click on the 'Allow only users with a specific email domain to join this team' checkbox + cy.get('.mm-modal-generic-section-item__input-checkbox').should('not.be.checked').click(); + }); + + // # Set 'sample.mattermost.com' as the only allowed email domain and save + cy.get('#allowedDomains').click().type(emailDomain).type(' '); + cy.findByText('Save').should('be.visible').click(); }); + cy.uiClose(); + // # Open team menu and click 'Invite People' cy.uiOpenTeamMenu('Invite People'); @@ -92,26 +98,26 @@ describe('Team Settings', () => { // * Check that the 'Team Settings' modal was opened cy.get('#teamSettingsModal').should('exist').within(() => { - // # Click on the 'Allow any user with an account on this server to join this team' edit button - cy.get('#open_inviteEdit').should('be.visible').click(); + // # Go to Access section + cy.get('#accessButton').click(); - // # Enable any user with an account on the server to join the team - cy.get('#teamOpenInvite').should('be.visible').check(); - - // # Save and verify it took effect - cy.uiSave(); - cy.get('#open_inviteDesc').should('be.visible').and('have.text', 'Yes'); + cy.get('.access-invite-domains-section').should('exist').within(() => { + // # Enable any user with an account on the server to join the team + cy.get('.mm-modal-generic-section-item__input-checkbox').should('not.be.checked').click(); + }); // # Click on the 'Allow only users with a specific email domain to join this team' edit button - cy.get('#allowed_domainsEdit').should('be.visible').click(); + cy.get('.access-allowed-domains-section').should('exist').within(() => { + // # Click on the 'Allow only users with a specific email domain to join this team' checkbox + cy.get('.mm-modal-generic-section-item__input-checkbox').should('not.be.checked').click(); + }); // # Set 'sample.mattermost.com' as the only allowed email domain and save - cy.wait(TIMEOUTS.HALF_SEC); - cy.findByRole('textbox', {name: 'Allowed Domains'}).should('be.visible').and('be.focused').type(emailDomain); + cy.get('#allowedDomains').click().type(emailDomain).type(' '); + cy.findByText('Save').should('be.visible').click(); // # Save and verify it took effect cy.uiSave(); - cy.get('#allowed_domainsDesc').should('be.visible').and('have.text', emailDomain); // # Close the modal cy.uiClose(); diff --git a/e2e-tests/cypress/tests/integration/channels/team_settings/remove_team_icon_spec.js b/e2e-tests/cypress/tests/integration/channels/team_settings/remove_team_icon_spec.js index ba1c0a0389..ca9fb8547e 100644 --- a/e2e-tests/cypress/tests/integration/channels/team_settings/remove_team_icon_spec.js +++ b/e2e-tests/cypress/tests/integration/channels/team_settings/remove_team_icon_spec.js @@ -28,56 +28,34 @@ describe('Teams Settings', () => { // # Open team settings dialog openTeamSettingsDialog(); - // * Verify the settings picture button is visible to click - cy.findByTestId('inputSettingPictureButton').should('be.visible').click(); - - // * Before uploading the picture the save button must be disabled - cy.uiSaveButton().should('be.disabled'); - // # Upload a file on center view cy.findByTestId('uploadPicture').attachFile('mattermost-icon.png'); - // * Save then close - cy.uiSaveAndClose(); + // * Save + cy.uiSave(); // * Verify team icon - cy.get(`#${testTeam.name}TeamButton`).within(() => { - cy.findByTestId('teamIconImage').should('be.visible'); - cy.findByTestId('teamIconInitial').should('not.exist'); - }); - - // # Open the team settings dialog - openTeamSettingsDialog(); - - // # Click on 'X' icon to remove the image - cy.findByTestId('removeSettingPicture').should('be.visible').click(); - - // # Click on the cancel button - cy.findByTestId('cancelSettingPicture').should('be.visible').click(); + cy.get('#teamIconImage').should('be.visible'); + cy.get('#teamIconInitial').should('not.exist'); // # Close the team settings dialog cy.uiClose(); - // * Verify the team icon image is visible and initial team holder is not visible - cy.get(`#${testTeam.name}TeamButton`).within(() => { - cy.findByTestId('teamIconImage').should('be.visible'); - cy.findByTestId('teamIconInitial').should('not.exist'); - }); - - // # Open team settings dialog + // # Open the team settings dialog openTeamSettingsDialog(); - // # Click on 'X' icon to remove the image - cy.findByTestId('removeSettingPicture').should('be.visible').click(); + // # Click on 'Remove Image' button to remove the image + cy.findByTestId('removeImageButton').should('be.visible').click(); - // # Save and close the modal - cy.uiSaveAndClose(); + // # Close the modal + cy.uiClose(); + + // # Open the team settings dialog + openTeamSettingsDialog(); // * After removing the team icon initial team holder is visible but not team icon holder - cy.get(`#${testTeam.name}TeamButton`).within(() => { - cy.findByTestId('teamIconImage').should('not.exist'); - cy.findByTestId('teamIconInitial').should('be.visible'); - }); + cy.get('#teamIconImage').should('not.exist'); + cy.get('#teamIconInitial').should('be.visible'); }); }); @@ -88,9 +66,11 @@ function openTeamSettingsDialog() { // * Verify the team settings dialog is open cy.get('#teamSettingsModalLabel').should('be.visible').and('contain', 'Team Settings'); - // * Verify the edit icon is visible - cy.get('#team_iconEdit').should('be.visible'); + cy.get('.team-picture-section').within(() => { + // * Verify the edit icon is visible + cy.get('.icon-pencil-outline').should('be.visible'); - // # Click on edit button - cy.get('#team_iconEdit').click(); + // # Click on edit button + cy.get('.icon-pencil-outline').click(); + }); } diff --git a/e2e-tests/cypress/tests/integration/channels/team_settings/teams_spec.js b/e2e-tests/cypress/tests/integration/channels/team_settings/teams_spec.js index 02d53bcc52..00fae8e087 100644 --- a/e2e-tests/cypress/tests/integration/channels/team_settings/teams_spec.js +++ b/e2e-tests/cypress/tests/integration/channels/team_settings/teams_spec.js @@ -186,6 +186,9 @@ describe('Teams Suite', () => { // # Open team menu and click "Team Settings" cy.uiOpenTeamMenu('Team Settings'); + // # Go to Access section + cy.get('#accessButton').click(); + // # Open edit settings for invite code cy.findByText('Invite Code').should('be.visible').click(); @@ -213,11 +216,8 @@ describe('Teams Suite', () => { // # Change team name in the input cy.get('#teamName').should('be.visible').clear().type(teamName); - // Save new team name - cy.findByText(/save/i).click(); - - // # Close the team settings - cy.get('body').typeWithForce('{esc}'); + // Save new team name annd close< + cy.uiSaveAndClose(); // Team display name shows as "Testing Team" at top of team menu cy.uiGetLHSHeader().findByText(teamName); @@ -238,9 +238,6 @@ describe('Teams Suite', () => { // # Open team menu and click "Team Settings" cy.uiOpenTeamMenu('Team Settings'); - // # Click on the team description menu item - cy.findByText('Team Description').should('be.visible').click(); - // # Change team description in the input cy.get('#teamDescription').should('be.visible').clear().type(teamDescription); cy.get('#teamDescription').should('have.value', teamDescription); @@ -252,7 +249,7 @@ describe('Teams Suite', () => { cy.uiOpenTeamMenu('Team Settings'); // * Verify team description is updated - cy.get('#descriptionDesc').should('have.text', teamDescription); + cy.get('#teamDescription').should('have.text', teamDescription); }); it('MM-T2318 Allow anyone to join this team', () => { @@ -262,17 +259,16 @@ describe('Teams Suite', () => { // # Open team menu and click "Team Settings" cy.uiOpenTeamMenu('Team Settings'); - // # Click on the team description menu item - cy.findByText('Allow any user with an account on this server to join this team').should('be.visible').click(); + // # Go to Access section + cy.get('#accessButton').click(); - // # Change team description in the input - cy.get('#teamOpenInvite').click(); + cy.get('.access-invite-domains-section').should('exist').within(() => { + // # Click on the 'Allow any user with an account on this server to join this team' checkbox + cy.get('.mm-modal-generic-section-item__input-checkbox').should('not.be.checked').click(); + }); - // Save new team description - cy.findByText(/save/i).click(); - - // # Close the team settings - cy.get('body').typeWithForce('{esc}'); + // # Save and close + cy.uiSaveAndClose(); // # Login as new user cy.apiLogin(newUser); @@ -302,14 +298,16 @@ describe('Teams Suite', () => { // # Open team menu and click "Team Settings" cy.uiOpenTeamMenu('Team Settings'); - // # Click on the team description menu item - cy.findByText('Allow any user with an account on this server to join this team').should('be.visible').click(); + // # Go to Access section + cy.get('#accessButton').click(); - // # Change team description in the input - cy.get('#teamOpenInviteNo').click(); + cy.get('.access-invite-domains-section').should('exist').within(() => { + // # Click on the 'Allow any user with an account on this server to join this team' checkbox + cy.get('.mm-modal-generic-section-item__input-checkbox').should('not.be.checked'); + }); - // Save new team description and close team settings - cy.uiSaveAndClose(); + // # Save and close + cy.uiClose(); // # Login as new user cy.apiLogin(testUser); diff --git a/webapp/channels/src/components/channel_name_form_field/channel_name_form_field.tsx b/webapp/channels/src/components/channel_name_form_field/channel_name_form_field.tsx index ae9d9f7fe9..6d208aa017 100644 --- a/webapp/channels/src/components/channel_name_form_field/channel_name_form_field.tsx +++ b/webapp/channels/src/components/channel_name_form_field/channel_name_form_field.tsx @@ -96,7 +96,7 @@ const ChannelNameFormField = (props: Props): JSX.Element => { } }, [props.onURLChange, displayName.current, url, displayNameModified]); - const handleOnURLChange = useCallback((e: React.ChangeEvent) => { + const handleOnURLChange = useCallback((e: React.ChangeEvent) => { e.preventDefault(); const {target: {value: url}} = e; diff --git a/webapp/channels/src/components/channel_notifications_modal/__snapshots__/channel_notifications_modal.test.tsx.snap b/webapp/channels/src/components/channel_notifications_modal/__snapshots__/channel_notifications_modal.test.tsx.snap index d66b237494..d00414fa8d 100644 --- a/webapp/channels/src/components/channel_notifications_modal/__snapshots__/channel_notifications_modal.test.tsx.snap +++ b/webapp/channels/src/components/channel_notifications_modal/__snapshots__/channel_notifications_modal.test.tsx.snap @@ -76,7 +76,7 @@ Object { class="mm-modal-generic-section" >