Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MM-61470] Fix rendering of AllowScreenSharing config setting #896

Merged
merged 1 commit into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions e2e/tests/admin_console.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,9 @@ test.describe('admin console', () => {
// Check dropdown input
await page.getByTestId('PluginSettings.Plugins.com+mattermost+calls.recordingqualitydropdown').selectOption('High');
await expect(await resizeAndScreenshot(page, 'PluginSettings.Plugins.com+mattermost+calls.recordingquality')).toMatchSnapshot('calls-system-console-recording-quality.png');

// Ensure AllowScreenSharing defaults to true
await expect(page.getByTestId('PluginSettings.Plugins.com+mattermost+calls.allowscreensharingtrue')).toBeChecked();
await expect(page.getByTestId('PluginSettings.Plugins.com+mattermost+calls.allowscreensharingfalse')).not.toBeChecked();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ export default function AllowScreenSharing(props: CustomComponentProps) {
props.onChange(props.id, e.target.value === 'true');
};

// This setting has a default of true so we need to handle the unset case.
// @ts-ignore val is a boolean, but the signature says 'string'. (being defensive here, just in case)
const checked = props.value === 'true' || props.value === true;
const checked = typeof props.value === 'undefined' || props.value === 'true' || props.value === true;

return (
<div
Expand Down