mirror of
https://github.com/element-hq/element-web.git
synced 2025-12-05 01:10:40 +00:00
Compare commits
2 Commits
midhun/mod
...
andybalaam
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
95974b53cb | ||
|
|
093a708b44 |
@@ -146,8 +146,8 @@ test.describe("Device verification", { tag: "@no-webkit" }, () => {
|
||||
);
|
||||
|
||||
// Confirm that the bot user scanned successfully
|
||||
await expect(infoDialog.getByText("Almost there! Is your other device showing the same shield?")).toBeVisible();
|
||||
await infoDialog.getByRole("button", { name: "Yes" }).click();
|
||||
await expect(infoDialog.getByText("Confirm that you see a green shield on your other device")).toBeVisible();
|
||||
await infoDialog.getByRole("button", { name: "Yes, I see a green shield" }).click();
|
||||
await infoDialog.getByRole("button", { name: "Got it" }).click();
|
||||
|
||||
// wait for the bot to see we have finished
|
||||
@@ -270,7 +270,7 @@ test.describe("Device verification", { tag: "@no-webkit" }, () => {
|
||||
// it should contain the device ID of the requesting device
|
||||
await expect(toast.getByText(`${aliceBotClient.credentials.deviceId} from `)).toBeVisible();
|
||||
// Accept
|
||||
await toast.getByRole("button", { name: "Verify Session" }).click();
|
||||
await toast.getByRole("button", { name: "Start verification" }).click();
|
||||
|
||||
/* Click 'Start' to start SAS verification */
|
||||
await page.getByRole("button", { name: "Start" }).click();
|
||||
@@ -285,10 +285,7 @@ test.describe("Device verification", { tag: "@no-webkit" }, () => {
|
||||
/* And we're all done! */
|
||||
const infoDialog = page.locator(".mx_InfoDialog");
|
||||
await infoDialog.getByRole("button", { name: "They match" }).click();
|
||||
// We don't assert the full string as the device name is unset on Synapse but set to the user ID on Dendrite
|
||||
await expect(infoDialog.getByText(`You've successfully verified`)).toContainText(
|
||||
`(${aliceBotClient.credentials.deviceId})`,
|
||||
);
|
||||
await expect(infoDialog.getByText("Device verified")).toBeVisible();
|
||||
await infoDialog.getByRole("button", { name: "Got it" }).click();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -228,7 +228,7 @@ test.describe("OIDC Native", { tag: ["@no-firefox", "@no-webkit"] }, () => {
|
||||
*/
|
||||
async function verifyUsingOtherDevice(deviceToVerifyPage: Page, alreadyVerifiedDevicePage: Page) {
|
||||
await deviceToVerifyPage.getByRole("button", { name: "Use another device" }).click();
|
||||
await alreadyVerifiedDevicePage.getByRole("button", { name: "Verify session" }).click();
|
||||
await alreadyVerifiedDevicePage.getByRole("button", { name: "Start verification" }).click();
|
||||
await alreadyVerifiedDevicePage.getByRole("button", { name: "Start" }).click();
|
||||
await alreadyVerifiedDevicePage.getByRole("button", { name: "They match" }).click();
|
||||
await deviceToVerifyPage.getByRole("button", { name: "They match" }).click();
|
||||
|
||||
@@ -8,6 +8,7 @@ Please see LICENSE files in the repository root for full details.
|
||||
|
||||
import React from "react";
|
||||
import { VerificationPhase, VerificationRequestEvent, type VerificationRequest } from "matrix-js-sdk/src/crypto-api";
|
||||
import { VerificationMethod } from "matrix-js-sdk/src/types";
|
||||
import { type User } from "matrix-js-sdk/src/matrix";
|
||||
|
||||
import { MatrixClientPeg } from "../../../MatrixClientPeg";
|
||||
@@ -111,10 +112,28 @@ export default class VerificationRequestDialog extends React.Component<IProps, I
|
||||
|
||||
private dialogTitle(request?: VerificationRequest): string {
|
||||
if (request?.isSelfVerification) {
|
||||
if (request.phase === VerificationPhase.Cancelled) {
|
||||
return _t("encryption|verification|verification_dialog_title_failed");
|
||||
} else {
|
||||
return _t("encryption|verification|verification_dialog_title_device");
|
||||
switch (request.phase) {
|
||||
case VerificationPhase.Ready:
|
||||
return _t("encryption|verification|verification_dialog_title_choose");
|
||||
case VerificationPhase.Done:
|
||||
return _t("encryption|verification|verification_dialog_title_verified");
|
||||
case VerificationPhase.Started:
|
||||
switch (request.chosenMethod) {
|
||||
case VerificationMethod.Reciprocate:
|
||||
return _t("encryption|verification|verification_dialog_title_confirm_green_shield");
|
||||
case VerificationMethod.Sas:
|
||||
return _t("encryption|verification|verification_dialog_title_compare_emojis");
|
||||
default:
|
||||
return _t("encryption|verification|verification_dialog_title_device");
|
||||
}
|
||||
case VerificationPhase.Unsent:
|
||||
return _t("encryption|verification|verification_dialog_title_unsent");
|
||||
case VerificationPhase.Requested:
|
||||
return _t("encryption|verification|verification_dialog_title_start_on_other_device");
|
||||
case VerificationPhase.Cancelled:
|
||||
return _t("encryption|verification|verification_dialog_title_failed");
|
||||
default:
|
||||
return _t("encryption|verification|verification_dialog_title_device");
|
||||
}
|
||||
} else {
|
||||
return _t("encryption|verification|verification_dialog_title_user");
|
||||
|
||||
@@ -43,7 +43,7 @@ const EncryptionInfo: React.FC<IProps> = ({
|
||||
}: IProps) => {
|
||||
let content: JSX.Element;
|
||||
if (waitingForOtherParty && isSelfVerification) {
|
||||
content = <div>{_t("encryption|verification|self_verification_hint")}</div>;
|
||||
content = <div>{_t("encryption|verification|once_accepted_can_continue")}</div>;
|
||||
} else if (waitingForOtherParty || waitingForNetwork) {
|
||||
let text: string;
|
||||
if (waitingForOtherParty) {
|
||||
|
||||
@@ -126,7 +126,7 @@ export default class VerificationPanel extends React.PureComponent<IProps, IStat
|
||||
) : null;
|
||||
return (
|
||||
<div>
|
||||
{_t("encryption|verification|qr_or_sas_header")}
|
||||
{_t("encryption|verification|verify_by_completing_one_of")}
|
||||
<div className="mx_VerificationPanel_QRPhase_startOptions">
|
||||
{qrBlockDialog}
|
||||
{or}
|
||||
@@ -224,7 +224,7 @@ export default class VerificationPanel extends React.PureComponent<IProps, IStat
|
||||
private renderQRReciprocatePhase(): JSX.Element {
|
||||
const { member, request } = this.props;
|
||||
const description = request.isSelfVerification
|
||||
? _t("encryption|verification|qr_reciprocate_same_shield_device")
|
||||
? _t("encryption|verification|qr_reciprocate_check_again_device")
|
||||
: _t("encryption|verification|qr_reciprocate_same_shield_user", {
|
||||
displayName: (member as User).displayName || (member as RoomMember).name || member.userId,
|
||||
});
|
||||
@@ -236,19 +236,18 @@ export default class VerificationPanel extends React.PureComponent<IProps, IStat
|
||||
<p>{description}</p>
|
||||
<E2EIcon isUser={true} status={E2EStatus.Verified} size={128} hideTooltip={true} />
|
||||
<div className="mx_VerificationPanel_reciprocateButtons">
|
||||
<AccessibleButton
|
||||
kind="danger"
|
||||
disabled={this.state.reciprocateButtonClicked}
|
||||
onClick={this.onReciprocateNoClick}
|
||||
>
|
||||
{_t("action|no")}
|
||||
</AccessibleButton>
|
||||
<AccessibleButton
|
||||
kind="primary"
|
||||
disabled={this.state.reciprocateButtonClicked}
|
||||
onClick={this.onReciprocateYesClick}
|
||||
>
|
||||
{_t("action|yes")}
|
||||
{_t("encryption|verification|qr_reciprocate_yes")}
|
||||
</AccessibleButton>
|
||||
<AccessibleButton
|
||||
disabled={this.state.reciprocateButtonClicked}
|
||||
onClick={this.onReciprocateNoClick}
|
||||
>
|
||||
{_t("encryption|verification|qr_reciprocate_no")}
|
||||
</AccessibleButton>
|
||||
</div>
|
||||
</React.Fragment>
|
||||
@@ -260,12 +259,7 @@ export default class VerificationPanel extends React.PureComponent<IProps, IStat
|
||||
</p>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<div className="mx_UserInfo_container mx_VerificationPanel_reciprocate_section">
|
||||
<h3>{_t("encryption|verification|scan_qr")}</h3>
|
||||
{body}
|
||||
</div>
|
||||
);
|
||||
return <div className="mx_UserInfo_container mx_VerificationPanel_reciprocate_section">{body}</div>;
|
||||
}
|
||||
|
||||
private renderVerifiedPhase(): JSX.Element {
|
||||
@@ -282,18 +276,7 @@ export default class VerificationPanel extends React.PureComponent<IProps, IStat
|
||||
|
||||
let description: string;
|
||||
if (request.isSelfVerification) {
|
||||
const device = this.state.otherDeviceDetails;
|
||||
if (!device) {
|
||||
// This can happen if the device is logged out while we're still showing verification
|
||||
// UI for it.
|
||||
logger.warn("Verified device we don't know about: " + this.props.request.otherDeviceId);
|
||||
description = _t("encryption|verification|successful_own_device");
|
||||
} else {
|
||||
description = _t("encryption|verification|successful_device", {
|
||||
deviceName: device.displayName,
|
||||
deviceId: device.deviceId,
|
||||
});
|
||||
}
|
||||
description = _t("encryption|verification|now_you_can");
|
||||
} else {
|
||||
description = _t("encryption|verification|successful_user", {
|
||||
displayName: (member as User).displayName || (member as RoomMember).name || member.userId,
|
||||
@@ -313,35 +296,9 @@ export default class VerificationPanel extends React.PureComponent<IProps, IStat
|
||||
}
|
||||
|
||||
private renderCancelledPhase(): JSX.Element {
|
||||
const { member, request } = this.props;
|
||||
|
||||
let startAgainInstruction: string;
|
||||
if (request.isSelfVerification) {
|
||||
startAgainInstruction = _t("encryption|verification|prompt_self");
|
||||
} else {
|
||||
startAgainInstruction = _t("encryption|verification|prompt_user");
|
||||
}
|
||||
|
||||
let text: string;
|
||||
if (request.cancellationCode === "m.timeout") {
|
||||
text = _t("encryption|verification|timed_out") + ` ${startAgainInstruction}`;
|
||||
} else if (request.cancellingUserId === request.otherUserId) {
|
||||
if (request.isSelfVerification) {
|
||||
text = _t("encryption|verification|cancelled_self");
|
||||
} else {
|
||||
text = _t("encryption|verification|cancelled_user", {
|
||||
displayName: (member as User).displayName || (member as RoomMember).name || member.userId,
|
||||
});
|
||||
}
|
||||
text = `${text} ${startAgainInstruction}`;
|
||||
} else {
|
||||
text = _t("encryption|verification|cancelled") + ` ${startAgainInstruction}`;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="mx_UserInfo_container">
|
||||
<h3>{_t("common|verification_cancelled")}</h3>
|
||||
<p>{text}</p>
|
||||
<p>{_t("encryption|verification|cancelled_verification")}</p>
|
||||
|
||||
<AccessibleButton kind="primary" className="mx_UserInfo_wideButton" onClick={this.props.onClose}>
|
||||
{_t("action|got_it")}
|
||||
|
||||
@@ -177,7 +177,7 @@ export default class VerificationRequestToast extends React.PureComponent<IProps
|
||||
detail={detail}
|
||||
primaryLabel={
|
||||
request.isSelfVerification || !request.roomId
|
||||
? _t("encryption|verification|request_toast_accept")
|
||||
? _t("encryption|verification|request_toast_start_verification")
|
||||
: _t("encryption|verification|request_toast_accept_user")
|
||||
}
|
||||
onPrimaryClick={this.accept}
|
||||
|
||||
@@ -119,7 +119,7 @@ export default class VerificationShowSas extends React.Component<IProps, IState>
|
||||
</div>
|
||||
);
|
||||
sasCaption = this.props.isSelf
|
||||
? _t("encryption|verification|sas_emoji_caption_self")
|
||||
? _t("encryption|verification|confirm_the_emojis")
|
||||
: _t("encryption|verification|sas_emoji_caption_user");
|
||||
} else if (this.props.sas.decimal) {
|
||||
const numberBlocks = this.props.sas.decimal.map((num, i) => <span key={i}>{num}</span>);
|
||||
|
||||
@@ -598,7 +598,6 @@
|
||||
"user": "User",
|
||||
"user_avatar": "Profile picture",
|
||||
"username": "Username",
|
||||
"verification_cancelled": "Verification cancelled",
|
||||
"verified": "Verified",
|
||||
"version": "Version",
|
||||
"video": "Video",
|
||||
@@ -993,9 +992,7 @@
|
||||
"skip_verification": "Skip verification for now",
|
||||
"verify_this_device": "Verify this device"
|
||||
},
|
||||
"cancelled": "You cancelled verification.",
|
||||
"cancelled_self": "You cancelled verification on your other device.",
|
||||
"cancelled_user": "%(displayName)s cancelled verification.",
|
||||
"cancelled_verification": "Either the request timed out, the request was denied, or there was a verification mismatch.",
|
||||
"cancelling": "Cancelling…",
|
||||
"cant_confirm": "Can't confirm?",
|
||||
"complete_action": "Got It",
|
||||
@@ -1003,6 +1000,7 @@
|
||||
"complete_title": "Verified!",
|
||||
"confirm_identity_description": "Verify this device to set up secure messaging",
|
||||
"confirm_identity_title": "Confirm your identity",
|
||||
"confirm_the_emojis": "Confirm that the emojis below match those shown on your other device.",
|
||||
"error_starting_description": "We were unable to start a chat with the other user.",
|
||||
"error_starting_title": "Error starting verification",
|
||||
"explainer": "Secure messages with this user are end-to-end encrypted and not able to be read by third parties.",
|
||||
@@ -1029,36 +1027,32 @@
|
||||
"wrong_fingerprint": "Unable to verify device '%(deviceId)s' - the supplied fingerprint '%(fingerprint)s' does not match the device fingerprint, '%(fprint)s'"
|
||||
},
|
||||
"no_support_qr_emoji": "The device you are trying to verify doesn't support scanning a QR code or emoji verification, which is what %(brand)s supports. Try with a different client.",
|
||||
"now_you_can": "Now you can read or send messages securely, and anyone you chat with can also trust this device.",
|
||||
"once_accepted_can_continue": "Once accepted you'll be able to continue with the verification.",
|
||||
"other_party_cancelled": "The other party cancelled the verification.",
|
||||
"prompt_encrypted": "Verify all users in a room to ensure it's secure.",
|
||||
"prompt_self": "Start verification again from the notification.",
|
||||
"prompt_unencrypted": "In encrypted rooms, verify all users to ensure it's secure.",
|
||||
"prompt_user": "Start verification again from their profile.",
|
||||
"qr_or_sas": "%(qrCode)s or %(emojiCompare)s",
|
||||
"qr_or_sas_header": "Verify this device by completing one of the following:",
|
||||
"qr_prompt": "Scan this unique code",
|
||||
"qr_reciprocate_same_shield_device": "Almost there! Is your other device showing the same shield?",
|
||||
"qr_reciprocate_check_again_device": "Check again on your other device to finish verification.",
|
||||
"qr_reciprocate_no": "No, I don't see a green shield",
|
||||
"qr_reciprocate_same_shield_user": "Almost there! Is %(displayName)s showing the same shield?",
|
||||
"request_toast_accept": "Verify Session",
|
||||
"qr_reciprocate_yes": "Yes, I see a green shield",
|
||||
"request_toast_accept_user": "Verify User",
|
||||
"request_toast_decline_counter": "Ignore (%(counter)s)",
|
||||
"request_toast_detail": "%(deviceId)s from %(ip)s",
|
||||
"request_toast_start_verification": "Start Verification",
|
||||
"sas_caption_self": "Verify this device by confirming the following number appears on its screen.",
|
||||
"sas_caption_user": "Verify this user by confirming the following number appears on their screen.",
|
||||
"sas_description": "Compare a unique set of emoji if you don't have a camera on either device",
|
||||
"sas_emoji_caption_self": "Confirm the emoji below are displayed on both devices, in the same order:",
|
||||
"sas_emoji_caption_user": "Verify this user by confirming the following emoji appear on their screen.",
|
||||
"sas_match": "They match",
|
||||
"sas_no_match": "They don't match",
|
||||
"sas_prompt": "Compare unique emoji",
|
||||
"scan_qr": "Verify by scanning",
|
||||
"scan_qr_explainer": "Ask %(displayName)s to scan your code:",
|
||||
"self_verification_hint": "To proceed, please accept the verification request on your other device.",
|
||||
"start_button": "Start Verification",
|
||||
"successful_device": "You've successfully verified %(deviceName)s (%(deviceId)s)!",
|
||||
"successful_own_device": "You've successfully verified your device!",
|
||||
"successful_user": "You've successfully verified %(displayName)s!",
|
||||
"timed_out": "Verification timed out.",
|
||||
"unsupported_method": "Unable to find a supported verification method.",
|
||||
"unverified_session_toast_accept": "Yes, it was me",
|
||||
"unverified_session_toast_title": "New login. Was this you?",
|
||||
@@ -1067,12 +1061,19 @@
|
||||
"unverified_sessions_toast_title": "You have unverified sessions",
|
||||
"use_another_device": "Use another device",
|
||||
"use_recovery_key": "Use recovery key",
|
||||
"verification_dialog_title_choose": "Choose how to verify",
|
||||
"verification_dialog_title_compare_emojis": "Compare emojis",
|
||||
"verification_dialog_title_confirm_green_shield": "Confirm that you see a green shield on your other device",
|
||||
"verification_dialog_title_device": "Verify other device",
|
||||
"verification_dialog_title_failed": "Verification failed",
|
||||
"verification_dialog_title_start_on_other_device": "Start verification on the other device",
|
||||
"verification_dialog_title_unsent": "encryption|verification|verification_dialog_title_unsent",
|
||||
"verification_dialog_title_user": "Verification Request",
|
||||
"verification_dialog_title_verified": "Device verified",
|
||||
"verification_skip_warning": "Without verifying, you won't have access to all your messages and may appear as untrusted to others.",
|
||||
"verification_success_with_backup": "Your new device is now verified. It has access to your encrypted messages, and other users will see it as trusted.",
|
||||
"verification_success_without_backup": "Your new device is now verified. Other users will see it as trusted.",
|
||||
"verify_by_completing_one_of": "Verify by completing one of the following:",
|
||||
"verify_emoji": "Verify by emoji",
|
||||
"verify_emoji_prompt": "Verify by comparing unique emoji.",
|
||||
"verify_emoji_prompt_qr": "If you can't scan the code above, verify by comparing unique emoji.",
|
||||
|
||||
@@ -35,8 +35,8 @@ describe("VerificationRequestDialog", () => {
|
||||
it("Initially, asks how you would like to verify this device", async () => {
|
||||
const dialog = renderComponent(VerificationPhase.Ready);
|
||||
|
||||
expect(screen.getByRole("heading", { name: "Verify other device" })).toBeInTheDocument();
|
||||
expect(screen.getByText("Verify this device by completing one of the following:")).toBeInTheDocument();
|
||||
expect(screen.getByRole("heading", { name: "Choose how to verify" })).toBeInTheDocument();
|
||||
expect(screen.getByText("Verify by completing one of the following:")).toBeInTheDocument();
|
||||
|
||||
expect(dialog.asFragment()).toMatchSnapshot();
|
||||
});
|
||||
@@ -44,11 +44,8 @@ describe("VerificationRequestDialog", () => {
|
||||
it("After we started verification here, says we are waiting for the other device", async () => {
|
||||
const dialog = renderComponent(VerificationPhase.Requested);
|
||||
|
||||
expect(screen.getByRole("heading", { name: "Verify other device" })).toBeInTheDocument();
|
||||
|
||||
expect(
|
||||
screen.getByText("To proceed, please accept the verification request on your other device."),
|
||||
).toBeInTheDocument();
|
||||
expect(screen.getByRole("heading", { name: "Start verification on the other device" })).toBeInTheDocument();
|
||||
expect(screen.getByText("Once accepted you'll be able to continue with the verification.")).toBeInTheDocument();
|
||||
|
||||
expect(dialog.asFragment()).toMatchSnapshot();
|
||||
});
|
||||
@@ -56,10 +53,10 @@ describe("VerificationRequestDialog", () => {
|
||||
it("When other device accepted emoji, displays emojis and asks for confirmation", async () => {
|
||||
const dialog = renderComponent(VerificationPhase.Started, "emoji");
|
||||
|
||||
expect(screen.getByRole("heading", { name: "Verify other device" })).toBeInTheDocument();
|
||||
expect(screen.getByRole("heading", { name: "Compare emojis" })).toBeInTheDocument();
|
||||
|
||||
expect(
|
||||
screen.getByText("Confirm the emoji below are displayed on both devices, in the same order:"),
|
||||
screen.getByText("Confirm that the emojis below match those shown on your other device."),
|
||||
).toBeInTheDocument();
|
||||
|
||||
expect(dialog.asFragment()).toMatchSnapshot();
|
||||
@@ -68,10 +65,18 @@ describe("VerificationRequestDialog", () => {
|
||||
it("After scanning QR, shows confirmation dialog", async () => {
|
||||
const dialog = renderComponent(VerificationPhase.Started, "qr");
|
||||
|
||||
expect(screen.getByRole("heading", { name: "Verify other device" })).toBeInTheDocument();
|
||||
expect(screen.getByRole("heading", { name: "Verify by scanning" })).toBeInTheDocument();
|
||||
expect(
|
||||
screen.getByRole("heading", {
|
||||
name: "Confirm that you see a green shield on your other device",
|
||||
}),
|
||||
).toBeInTheDocument();
|
||||
|
||||
expect(screen.getByText("Almost there! Is your other device showing the same shield?")).toBeInTheDocument();
|
||||
// We used to have a subheading here: confirm it is not present.
|
||||
expect(screen.queryByRole("heading", { name: "Verify by scanning" })).not.toBeInTheDocument();
|
||||
|
||||
expect(screen.getByText("Check again on your other device to finish verification.")).toBeInTheDocument();
|
||||
expect(screen.getByRole("button", { name: "Yes, I see a green shield" })).toBeInTheDocument();
|
||||
expect(screen.getByRole("button", { name: "No, I don't see a green shield" })).toBeInTheDocument();
|
||||
|
||||
expect(dialog.asFragment()).toMatchSnapshot();
|
||||
});
|
||||
@@ -79,8 +84,13 @@ describe("VerificationRequestDialog", () => {
|
||||
it("Shows a successful message if verification finished normally", async () => {
|
||||
const dialog = renderComponent(VerificationPhase.Done);
|
||||
|
||||
expect(screen.getByRole("heading", { name: "Verify other device" })).toBeInTheDocument();
|
||||
expect(screen.getByText("You've successfully verified your device!")).toBeInTheDocument();
|
||||
expect(screen.getByRole("heading", { name: "Device verified" })).toBeInTheDocument();
|
||||
|
||||
expect(
|
||||
screen.getByText(
|
||||
"Now you can read or send messages securely, and anyone you chat with can also trust this device.",
|
||||
),
|
||||
).toBeInTheDocument();
|
||||
|
||||
expect(dialog.asFragment()).toMatchSnapshot();
|
||||
});
|
||||
@@ -89,11 +99,13 @@ describe("VerificationRequestDialog", () => {
|
||||
const dialog = renderComponent(VerificationPhase.Cancelled);
|
||||
|
||||
expect(screen.getByRole("heading", { name: "Verification failed" })).toBeInTheDocument();
|
||||
expect(screen.getByRole("heading", { name: "Verification cancelled" })).toBeInTheDocument();
|
||||
|
||||
// We used to have a sub-heading here: confirm is it not present.
|
||||
expect(screen.queryByRole("heading", { name: "Verification cancelled" })).not.toBeInTheDocument();
|
||||
|
||||
expect(
|
||||
screen.getByText(
|
||||
"You cancelled verification on your other device. Start verification again from the notification.",
|
||||
"Either the request timed out, the request was denied, or there was a verification mismatch.",
|
||||
),
|
||||
).toBeInTheDocument();
|
||||
|
||||
@@ -119,11 +131,10 @@ describe("VerificationRequestDialog", () => {
|
||||
|
||||
// Then it renders the resolved information
|
||||
expect(screen.getByRole("heading", { name: "Verification failed" })).toBeInTheDocument();
|
||||
expect(screen.getByRole("heading", { name: "Verification cancelled" })).toBeInTheDocument();
|
||||
|
||||
expect(
|
||||
screen.getByText(
|
||||
"You cancelled verification on your other device. Start verification again from the notification.",
|
||||
"Either the request timed out, the request was denied, or there was a verification mismatch.",
|
||||
),
|
||||
).toBeInTheDocument();
|
||||
});
|
||||
@@ -149,11 +160,10 @@ describe("VerificationRequestDialog", () => {
|
||||
|
||||
// Then it renders the information from the request in the promise
|
||||
expect(screen.getByRole("heading", { name: "Verification failed" })).toBeInTheDocument();
|
||||
expect(screen.getByRole("heading", { name: "Verification cancelled" })).toBeInTheDocument();
|
||||
|
||||
expect(
|
||||
screen.getByText(
|
||||
"You cancelled verification on your other device. Start verification again from the notification.",
|
||||
"Either the request timed out, the request was denied, or there was a verification mismatch.",
|
||||
),
|
||||
).toBeInTheDocument();
|
||||
});
|
||||
@@ -170,11 +180,10 @@ describe("VerificationRequestDialog", () => {
|
||||
|
||||
// Then the dialog is updated to reflect that
|
||||
expect(screen.getByRole("heading", { name: "Verification failed" })).toBeInTheDocument();
|
||||
expect(screen.getByRole("heading", { name: "Verification cancelled" })).toBeInTheDocument();
|
||||
|
||||
expect(
|
||||
screen.getByText(
|
||||
"You cancelled verification on your other device. Start verification again from the notification.",
|
||||
"Either the request timed out, the request was denied, or there was a verification mismatch.",
|
||||
),
|
||||
).toBeInTheDocument();
|
||||
});
|
||||
@@ -327,7 +336,7 @@ class MockVerificationRequest
|
||||
}
|
||||
|
||||
async generateQRCode(): Promise<Uint8ClampedArray | undefined> {
|
||||
return undefined;
|
||||
return new Uint8ClampedArray();
|
||||
}
|
||||
|
||||
get cancellationCode(): string | null {
|
||||
|
||||
@@ -22,17 +22,14 @@ exports[`VerificationRequestDialog After scanning QR, shows confirmation dialog
|
||||
class="mx_Heading_h3 mx_Dialog_title"
|
||||
id="mx_BaseDialog_title"
|
||||
>
|
||||
Verify other device
|
||||
Confirm that you see a green shield on your other device
|
||||
</h1>
|
||||
</div>
|
||||
<div
|
||||
class="mx_UserInfo_container mx_VerificationPanel_reciprocate_section"
|
||||
>
|
||||
<h3>
|
||||
Verify by scanning
|
||||
</h3>
|
||||
<p>
|
||||
Almost there! Is your other device showing the same shield?
|
||||
Check again on your other device to finish verification.
|
||||
</p>
|
||||
<div
|
||||
class="mx_E2EIcon mx_E2EIcon_verified"
|
||||
@@ -46,19 +43,19 @@ exports[`VerificationRequestDialog After scanning QR, shows confirmation dialog
|
||||
<div
|
||||
class="mx_VerificationPanel_reciprocateButtons"
|
||||
>
|
||||
<div
|
||||
class="mx_AccessibleButton mx_AccessibleButton_hasKind mx_AccessibleButton_kind_danger"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
>
|
||||
No
|
||||
</div>
|
||||
<div
|
||||
class="mx_AccessibleButton mx_AccessibleButton_hasKind mx_AccessibleButton_kind_primary"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
>
|
||||
Yes
|
||||
Yes, I see a green shield
|
||||
</div>
|
||||
<div
|
||||
class="mx_AccessibleButton"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
>
|
||||
No, I don't see a green shield
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -99,11 +96,11 @@ exports[`VerificationRequestDialog After we started verification here, says we a
|
||||
class="mx_Heading_h3 mx_Dialog_title"
|
||||
id="mx_BaseDialog_title"
|
||||
>
|
||||
Verify other device
|
||||
Start verification on the other device
|
||||
</h1>
|
||||
</div>
|
||||
<div>
|
||||
To proceed, please accept the verification request on your other device.
|
||||
Once accepted you'll be able to continue with the verification.
|
||||
</div>
|
||||
<div
|
||||
aria-describedby="«r6»"
|
||||
@@ -143,11 +140,11 @@ exports[`VerificationRequestDialog Initially, asks how you would like to verify
|
||||
class="mx_Heading_h3 mx_Dialog_title"
|
||||
id="mx_BaseDialog_title"
|
||||
>
|
||||
Verify other device
|
||||
Choose how to verify
|
||||
</h1>
|
||||
</div>
|
||||
<div>
|
||||
Verify this device by completing one of the following:
|
||||
Verify by completing one of the following:
|
||||
<div
|
||||
class="mx_VerificationPanel_QRPhase_startOptions"
|
||||
>
|
||||
@@ -242,11 +239,8 @@ exports[`VerificationRequestDialog Shows a failure message if verification was c
|
||||
<div
|
||||
class="mx_UserInfo_container"
|
||||
>
|
||||
<h3>
|
||||
Verification cancelled
|
||||
</h3>
|
||||
<p>
|
||||
You cancelled verification on your other device. Start verification again from the notification.
|
||||
Either the request timed out, the request was denied, or there was a verification mismatch.
|
||||
</p>
|
||||
<div
|
||||
class="mx_AccessibleButton mx_UserInfo_wideButton mx_AccessibleButton_hasKind mx_AccessibleButton_kind_primary"
|
||||
@@ -293,14 +287,14 @@ exports[`VerificationRequestDialog Shows a successful message if verification fi
|
||||
class="mx_Heading_h3 mx_Dialog_title"
|
||||
id="mx_BaseDialog_title"
|
||||
>
|
||||
Verify other device
|
||||
Device verified
|
||||
</h1>
|
||||
</div>
|
||||
<div
|
||||
class="mx_UserInfo_container mx_VerificationPanel_verified_section"
|
||||
>
|
||||
<p>
|
||||
You've successfully verified your device!
|
||||
Now you can read or send messages securely, and anyone you chat with can also trust this device.
|
||||
</p>
|
||||
<div
|
||||
class="mx_E2EIcon mx_E2EIcon_verified"
|
||||
@@ -356,7 +350,7 @@ exports[`VerificationRequestDialog When other device accepted emoji, displays em
|
||||
class="mx_Heading_h3 mx_Dialog_title"
|
||||
id="mx_BaseDialog_title"
|
||||
>
|
||||
Verify other device
|
||||
Compare emojis
|
||||
</h1>
|
||||
</div>
|
||||
<div
|
||||
@@ -366,7 +360,7 @@ exports[`VerificationRequestDialog When other device accepted emoji, displays em
|
||||
class="mx_VerificationShowSas"
|
||||
>
|
||||
<p>
|
||||
Confirm the emoji below are displayed on both devices, in the same order:
|
||||
Confirm that the emojis below match those shown on your other device.
|
||||
</p>
|
||||
<div
|
||||
class="mx_VerificationShowSas_emojiSas"
|
||||
|
||||
@@ -28,7 +28,7 @@ exports[`VerificationRequestToast should render a cross-user verification 1`] =
|
||||
role="button"
|
||||
tabindex="0"
|
||||
>
|
||||
Verify Session
|
||||
Start Verification
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -68,7 +68,7 @@ exports[`VerificationRequestToast should render a self-verification 1`] = `
|
||||
role="button"
|
||||
tabindex="0"
|
||||
>
|
||||
Verify Session
|
||||
Start Verification
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user