mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
MM-62891 Fixed incorrectly applied label in Team Settings modal (#30116)
This commit is contained in:
parent
9aaa52136c
commit
55bb6c51eb
@ -58,7 +58,7 @@ const AllowedDomainsSelect = ({allowedDomains, setAllowedDomains, setHasChanges,
|
||||
defaultMessage: 'When enabled, users can only join the team if their email matches a specific domain (e.g. "mattermost.org")',
|
||||
})}
|
||||
descriptionAboveContent={true}
|
||||
inputFieldData={{name: 'name'}}
|
||||
inputFieldData={{name: 'showAllowedDomains'}}
|
||||
inputFieldValue={showAllowedDomains}
|
||||
handleChange={handleEnableAllowedDomains}
|
||||
/>
|
||||
|
@ -57,10 +57,10 @@ const OpenInvite = ({isGroupConstrained, allowOpenInvite, setAllowOpenInvite}: P
|
||||
inputFieldTitle={
|
||||
<FormattedMessage
|
||||
id='general_tab.openInviteTitle'
|
||||
defaultMessage='Allow only users with a specific email domain to join this team'
|
||||
defaultMessage='Allow any user with an account on this server to join this team'
|
||||
/>
|
||||
}
|
||||
inputFieldData={{name: 'name'}}
|
||||
inputFieldData={{name: 'allowOpenInvite'}}
|
||||
inputFieldValue={allowOpenInvite}
|
||||
handleChange={setAllowOpenInvite}
|
||||
title={formatMessage({
|
||||
|
@ -120,4 +120,31 @@ describe('components/TeamSettings', () => {
|
||||
id: defaultProps.team?.id,
|
||||
});
|
||||
});
|
||||
|
||||
test('MM-62891 should toggle the right checkboxes when their labels are clicked on', () => {
|
||||
renderWithContext(<AccessTab {...defaultProps}/>);
|
||||
|
||||
expect(screen.getByRole('checkbox', {name: 'Allow only users with a specific email domain to join this team'})).not.toBeChecked();
|
||||
expect(screen.getByRole('checkbox', {name: 'Allow any user with an account on this server to join this team'})).not.toBeChecked();
|
||||
|
||||
userEvent.click(screen.getByText('Allow only users with a specific email domain to join this team'));
|
||||
|
||||
expect(screen.getByRole('checkbox', {name: 'Allow only users with a specific email domain to join this team'})).toBeChecked();
|
||||
expect(screen.getByRole('checkbox', {name: 'Allow any user with an account on this server to join this team'})).not.toBeChecked();
|
||||
|
||||
userEvent.click(screen.getByText('Allow only users with a specific email domain to join this team'));
|
||||
|
||||
expect(screen.getByRole('checkbox', {name: 'Allow only users with a specific email domain to join this team'})).not.toBeChecked();
|
||||
expect(screen.getByRole('checkbox', {name: 'Allow any user with an account on this server to join this team'})).not.toBeChecked();
|
||||
|
||||
userEvent.click(screen.getByText('Allow any user with an account on this server to join this team'));
|
||||
|
||||
expect(screen.getByRole('checkbox', {name: 'Allow only users with a specific email domain to join this team'})).not.toBeChecked();
|
||||
expect(screen.getByRole('checkbox', {name: 'Allow any user with an account on this server to join this team'})).toBeChecked();
|
||||
|
||||
userEvent.click(screen.getByText('Allow any user with an account on this server to join this team'));
|
||||
|
||||
expect(screen.getByRole('checkbox', {name: 'Allow only users with a specific email domain to join this team'})).not.toBeChecked();
|
||||
expect(screen.getByRole('checkbox', {name: 'Allow any user with an account on this server to join this team'})).not.toBeChecked();
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user