mirror of
https://github.com/vector-im/element-web.git
synced 2026-05-05 12:16:53 +02:00
Add tests for user security tab.
This commit is contained in:
parent
2c857f8fe3
commit
ddb2136d43
@ -41,6 +41,16 @@ test.describe("Security user settings tab", () => {
|
||||
});
|
||||
});
|
||||
|
||||
test.only("should render the security tab", { tag: "@screenshot"}, async ({ app, page, user }) => {
|
||||
await page.setViewportSize({ width: 1024, height: 1400 });
|
||||
const tab = await app.settings.openUserSettings("Security");
|
||||
await expect(tab).toMatchScreenshot("security-settings-tab.png", { mask: [
|
||||
// Contains IM name.
|
||||
tab.locator("#mx_SetIntegrationManager_BodyText"),
|
||||
tab.locator("#mx_SetIntegrationManager_ManagerName"),
|
||||
]});
|
||||
});
|
||||
|
||||
test("should be able to set an ID server", async ({ app, context, user, page }) => {
|
||||
const tab = await app.settings.openUserSettings("Security");
|
||||
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 109 KiB |
@ -9,7 +9,7 @@ Please see LICENSE files in the repository root for full details.
|
||||
import React from "react";
|
||||
import { logger } from "matrix-js-sdk/src/logger";
|
||||
import { type EmptyObject } from "matrix-js-sdk/src/matrix";
|
||||
import { SettingsToggleInput } from "@vector-im/compound-web";
|
||||
import { Form, SettingsToggleInput } from "@vector-im/compound-web";
|
||||
|
||||
import { _t } from "../../../languageHandler";
|
||||
import { IntegrationManagers } from "../../../integrations/IntegrationManagers";
|
||||
@ -66,14 +66,14 @@ export default class SetIntegrationManager extends React.Component<EmptyObject,
|
||||
if (!SettingsStore.getValue(UIFeature.Widgets)) return null;
|
||||
|
||||
return (
|
||||
<div className="mx_SetIntegrationManager" data-testid="mx_SetIntegrationManager">
|
||||
<Form.Root onSubmit={(evt) => {evt.preventDefault(); evt.stopPropagation();}} className="mx_SetIntegrationManager" data-testid="mx_SetIntegrationManager">
|
||||
<div className="mx_SettingsFlag">
|
||||
<div className="mx_SetIntegrationManager_heading_manager">
|
||||
<Heading size="3">{_t("integration_manager|manage_title")}</Heading>
|
||||
<Heading size="4">{managerName}</Heading>
|
||||
</div>
|
||||
</div>
|
||||
<SettingsSubsectionText>{bodyText}</SettingsSubsectionText>
|
||||
<SettingsSubsectionText id="mx_SetIntegrationManager_BodyText">{bodyText}</SettingsSubsectionText>
|
||||
<SettingsSubsectionText>{_t("integration_manager|explainer")}</SettingsSubsectionText>
|
||||
<SettingsToggleInput
|
||||
name="enable_im"
|
||||
@ -81,7 +81,7 @@ export default class SetIntegrationManager extends React.Component<EmptyObject,
|
||||
checked={this.state.provisioningEnabled}
|
||||
onChange={this.onProvisioningToggled}
|
||||
/>
|
||||
</div>
|
||||
</Form.Root>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -356,19 +356,21 @@ export default class SecurityUserSettingsTab extends React.Component<IProps, ISt
|
||||
|
||||
return (
|
||||
<SettingsTab>
|
||||
<Form.Root onSubmit={(evt) => {evt.preventDefault(); evt.stopPropagation();}}>
|
||||
{warning}
|
||||
<SetIntegrationManager />
|
||||
<SettingsSection heading={_t("settings|security|encryption_section")}>
|
||||
{secureBackup}
|
||||
{eventIndex}
|
||||
</SettingsSection>
|
||||
<Form.Root onSubmit={(evt) => {evt.preventDefault(); evt.stopPropagation();}}>
|
||||
<SettingsSection heading={_t("settings|security|encryption_section")}>
|
||||
{secureBackup}
|
||||
{eventIndex}
|
||||
</SettingsSection>
|
||||
</Form.Root>
|
||||
<SettingsSection heading={_t("common|privacy")}>
|
||||
<DiscoverySettings />
|
||||
{posthogSection}
|
||||
<Form.Root onSubmit={(evt) => {evt.preventDefault(); evt.stopPropagation();}}>
|
||||
{posthogSection}
|
||||
</Form.Root>
|
||||
</SettingsSection>
|
||||
{advancedSection}
|
||||
</Form.Root>
|
||||
</SettingsTab>
|
||||
);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user