mirror of
https://github.com/mattermost/mattermost.git
synced 2026-08-27 05:37:15 -05:00
MM-69842 - Update Team Settings discoverability help text for Public/… (#37728)
* MM-69842 - Update Team Settings discoverability help text for Public/Private cards * adjust e2e test to assert correctly the count of element * fix e2e test
This commit is contained in:
+29
-2
@@ -89,8 +89,8 @@ test.describe('Team Settings Modal - Access Tab - Discoverability', {tag: ['@aba
|
||||
await teamSettings.openAccessTab();
|
||||
|
||||
// * Public and Private cards are visible
|
||||
await expect(teamSettings.container.getByText('Public Team')).toBeVisible();
|
||||
await expect(teamSettings.container.getByText('Private Team')).toBeVisible();
|
||||
await expect(teamSettings.container.getByText('Public Team', {exact: true})).toBeVisible();
|
||||
await expect(teamSettings.container.getByText('Private Team', {exact: true})).toBeVisible();
|
||||
|
||||
// * Old open-invite checkboxes are gone
|
||||
await expect(teamSettings.container.locator('input[name="allowOpenInvite"]')).not.toBeVisible();
|
||||
@@ -502,4 +502,31 @@ test.describe('Team Settings Modal - Access Tab - Discoverability', {tag: ['@aba
|
||||
|
||||
await teamSettings.close();
|
||||
});
|
||||
|
||||
test('MM-69100_45 Access tab shows the updated discoverability help text', async ({pw}) => {
|
||||
await pw.skipIfNoLicense();
|
||||
const {adminUser, adminClient, team} = await pw.initSetup();
|
||||
await enableTeamMembershipABACConfig(adminClient);
|
||||
|
||||
const {page} = await pw.testBrowser.login(adminUser);
|
||||
const channelsPage = new ChannelsPage(page);
|
||||
|
||||
// # Navigate and open Team Settings
|
||||
await channelsPage.goto(team.name, 'town-square');
|
||||
await channelsPage.toBeVisible();
|
||||
const teamSettings = await channelsPage.openTeamSettings();
|
||||
await teamSettings.openAccessTab();
|
||||
|
||||
// * Updated card-aligned help text is shown
|
||||
await expect(
|
||||
teamSettings.container.getByText(
|
||||
/Switching a team from Public to Private regenerates its invitation code/i,
|
||||
),
|
||||
).toBeVisible();
|
||||
|
||||
// * Stale checkbox-era copy is gone
|
||||
await expect(teamSettings.container.getByText(/Changing from 'Yes' to 'No'/i)).toHaveCount(0);
|
||||
|
||||
await teamSettings.close();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -26,6 +26,8 @@ describe('components/TeamSettings/OpenInvite', () => {
|
||||
);
|
||||
expect(screen.getByText(/members of this team are added and removed by linked groups/i)).toBeInTheDocument();
|
||||
expect(screen.getByText('Learn More')).toBeInTheDocument();
|
||||
expect(screen.getByText(/Public teams appear on the server landing page/i)).toBeInTheDocument();
|
||||
expect(screen.queryByText(/Switching a team from Public to Private/i)).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
test('renders Public and Private option buttons when not group-constrained', () => {
|
||||
@@ -34,6 +36,12 @@ describe('components/TeamSettings/OpenInvite', () => {
|
||||
expect(screen.getByText('Private Team')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
test('renders the updated discoverability help text, not the stale checkbox copy', () => {
|
||||
renderWithContext(<OpenInvite {...defaultProps}/>);
|
||||
expect(screen.getByText(/Switching a team from Public to Private regenerates its invitation code/i)).toBeInTheDocument();
|
||||
expect(screen.queryByText(/Changing from 'Yes' to 'No'/i)).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
test('calls onChange(true) when Public Team card is clicked while private', async () => {
|
||||
renderWithContext(
|
||||
<OpenInvite
|
||||
|
||||
@@ -45,8 +45,8 @@ const OpenInvite = ({isPublic, isGroupConstrained, onChange}: Props) => {
|
||||
defaultMessage: 'Discoverability',
|
||||
})}
|
||||
description={formatMessage({
|
||||
id: 'general_tab.openInviteDesc',
|
||||
defaultMessage: "When allowed, a link to this team will be included on the landing page allowing anyone with an account to join this team. Changing from 'Yes' to 'No' will regenerate the invitation code, create a new invitation link and invalidate the previous link.",
|
||||
id: 'team_settings.discoverability.group_constrained_description',
|
||||
defaultMessage: 'Public teams appear on the server landing page so anyone with an account can find and join them.',
|
||||
})}
|
||||
descriptionAboveContent={true}
|
||||
content={groupConstrainedContent}
|
||||
@@ -95,8 +95,8 @@ const OpenInvite = ({isPublic, isGroupConstrained, onChange}: Props) => {
|
||||
defaultMessage: 'Discoverability',
|
||||
})}
|
||||
description={formatMessage({
|
||||
id: 'general_tab.openInviteDesc',
|
||||
defaultMessage: "When allowed, a link to this team will be included on the landing page allowing anyone with an account to join this team. Changing from 'Yes' to 'No' will regenerate the invitation code, create a new invitation link and invalidate the previous link.",
|
||||
id: 'team_settings.discoverability.description',
|
||||
defaultMessage: 'Public teams appear on the server landing page so anyone with an account can find and join them. Switching a team from Public to Private regenerates its invitation code, which creates a new invitation link and invalidates the old one.',
|
||||
})}
|
||||
descriptionAboveContent={true}
|
||||
content={selectorContent}
|
||||
|
||||
@@ -5275,7 +5275,6 @@
|
||||
"general_tab.AllowedDomainsTitle": "Users with a specific email domain",
|
||||
"general_tab.codeLongDesc": "The Invite Code is part of the unique team invitation link which is sent to members you’re inviting to this team. Regenerating the code creates a new invitation link and invalidates the previous link.",
|
||||
"general_tab.codeTitle": "Invite Code",
|
||||
"general_tab.openInviteDesc": "When allowed, a link to this team will be included on the landing page allowing anyone with an account to join this team. Changing from 'Yes' to 'No' will regenerate the invitation code, create a new invitation link and invalidate the previous link.",
|
||||
"general_tab.regenerate": "Regenerate",
|
||||
"general_tab.required": "This field is required",
|
||||
"general_tab.teamDescription": "Description",
|
||||
@@ -7206,6 +7205,8 @@
|
||||
"team_settings_modal.title": "Team Settings",
|
||||
"team_settings.access_policies.add_policy": "Add policy",
|
||||
"team_settings.access_policies.title": "Channel membership policies",
|
||||
"team_settings.discoverability.description": "Public teams appear on the server landing page so anyone with an account can find and join them. Switching a team from Public to Private regenerates its invitation code, which creates a new invitation link and invalidates the old one.",
|
||||
"team_settings.discoverability.group_constrained_description": "Public teams appear on the server landing page so anyone with an account can find and join them.",
|
||||
"team_settings.discoverability.private_description": "Only invited members can join",
|
||||
"team_settings.discoverability.private_title": "Private Team",
|
||||
"team_settings.discoverability.public_description": "Anyone on the server can find and join",
|
||||
|
||||
Reference in New Issue
Block a user