mirror of
https://github.com/vector-im/element-web.git
synced 2025-12-28 12:41:54 +01:00
Update tests
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
0961e6f6e4
commit
4613c44f47
@ -594,12 +594,14 @@ describe("RoomView", () => {
|
||||
|
||||
const { container } = await renderRoomView();
|
||||
// We no longer show the grey shield for encrypted rooms, so it should not be there.
|
||||
await waitFor(() => expect(container.querySelector(".mx_E2EIcon_normal")).not.toBeInTheDocument());
|
||||
await waitFor(() => expect(container.querySelector(".mx_E2EIcon")).not.toBeInTheDocument());
|
||||
|
||||
const verificationStatus = new UserVerificationStatus(true, true, false);
|
||||
jest.spyOn(cli.getCrypto()!, "getUserVerificationStatus").mockResolvedValue(verificationStatus);
|
||||
cli.emit(CryptoEvent.UserTrustStatusChanged, cli.getSafeUserId(), verificationStatus);
|
||||
await waitFor(() => expect(container.querySelector(".mx_E2EIcon_verified")).toBeInTheDocument());
|
||||
await waitFor(() =>
|
||||
expect(container.querySelector(".mx_E2EIcon")).toHaveAccessibleName("Everyone in this room is verified"),
|
||||
);
|
||||
});
|
||||
|
||||
describe("video rooms", () => {
|
||||
|
||||
@ -63,6 +63,17 @@ exports[`MessagePanel should handle lots of membership events quickly 1`] = `
|
||||
<div
|
||||
class="mx_EventTileBubble mx_HistoryTile"
|
||||
>
|
||||
<svg
|
||||
fill="currentColor"
|
||||
height="1em"
|
||||
viewBox="0 0 24 24"
|
||||
width="1em"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
d="m16.1 13.3-1.45-1.45q.225-1.175-.675-2.2t-2.325-.8L10.2 7.4q.424-.2.863-.3A4.2 4.2 0 0 1 12 7q1.875 0 3.188 1.312Q16.5 9.625 16.5 11.5q0 .5-.1.938t-.3.862m3.2 3.15-1.45-1.4a11 11 0 0 0 1.688-1.588A9 9 0 0 0 20.8 11.5q-1.25-2.524-3.588-4.013Q14.875 6 12 6q-.724 0-1.425.1a10 10 0 0 0-1.375.3L7.65 4.85A11.1 11.1 0 0 1 12 4q3.575 0 6.425 1.887T22.7 10.8a.8.8 0 0 1 .1.313q.025.188.025.387a2 2 0 0 1-.125.7 10.9 10.9 0 0 1-3.4 4.25m-.2 5.45-3.5-3.45q-.874.274-1.762.413Q12.95 19 12 19q-3.575 0-6.425-1.887T1.3 12.2a.8.8 0 0 1-.1-.312 3 3 0 0 1 0-.763.8.8 0 0 1 .1-.3Q1.825 9.7 2.55 8.75A13.3 13.3 0 0 1 4.15 7L2.075 4.9a.93.93 0 0 1-.275-.688q0-.412.3-.712a.95.95 0 0 1 .7-.275q.425 0 .7.275l17 17q.275.275.288.688a.93.93 0 0 1-.288.712.95.95 0 0 1-.7.275.95.95 0 0 1-.7-.275M5.55 8.4q-.725.65-1.325 1.425A9 9 0 0 0 3.2 11.5q1.25 2.524 3.588 4.012T12 17q.5 0 .975-.062.475-.063.975-.138l-.9-.95q-.274.075-.525.113A3.5 3.5 0 0 1 12 16q-1.875 0-3.187-1.312Q7.5 13.375 7.5 11.5q0-.274.038-.525.037-.25.112-.525z"
|
||||
/>
|
||||
</svg>
|
||||
<div
|
||||
class="mx_EventTileBubble_title"
|
||||
>
|
||||
|
||||
@ -141,8 +141,20 @@ exports[`RoomView for a local room in state ERROR should match the snapshot 1`]
|
||||
class="mx_NewRoomIntro"
|
||||
>
|
||||
<div
|
||||
class="mx_EventTileBubble mx_cryptoEvent mx_cryptoEvent_icon_warning"
|
||||
class="mx_EventTileBubble mx_cryptoEvent"
|
||||
>
|
||||
<svg
|
||||
color="var(--cpd-color-icon-critical-primary)"
|
||||
fill="currentColor"
|
||||
height="1em"
|
||||
viewBox="0 0 24 24"
|
||||
width="1em"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
d="M12 17q.424 0 .713-.288A.97.97 0 0 0 13 16a.97.97 0 0 0-.287-.713A.97.97 0 0 0 12 15a.97.97 0 0 0-.713.287A.97.97 0 0 0 11 16q0 .424.287.712.288.288.713.288m0-4q.424 0 .713-.287A.97.97 0 0 0 13 12V8a.97.97 0 0 0-.287-.713A.97.97 0 0 0 12 7a.97.97 0 0 0-.713.287A.97.97 0 0 0 11 8v4q0 .424.287.713.288.287.713.287m0 9a9.7 9.7 0 0 1-3.9-.788 10.1 10.1 0 0 1-3.175-2.137q-1.35-1.35-2.137-3.175A9.7 9.7 0 0 1 2 12q0-2.075.788-3.9a10.1 10.1 0 0 1 2.137-3.175q1.35-1.35 3.175-2.137A9.7 9.7 0 0 1 12 2q2.075 0 3.9.788a10.1 10.1 0 0 1 3.175 2.137q1.35 1.35 2.137 3.175A9.7 9.7 0 0 1 22 12a9.7 9.7 0 0 1-.788 3.9 10.1 10.1 0 0 1-2.137 3.175q-1.35 1.35-3.175 2.137A9.7 9.7 0 0 1 12 22"
|
||||
/>
|
||||
</svg>
|
||||
<div
|
||||
class="mx_EventTileBubble_title"
|
||||
>
|
||||
@ -311,8 +323,20 @@ exports[`RoomView for a local room in state NEW should match the snapshot 1`] =
|
||||
class="mx_NewRoomIntro"
|
||||
>
|
||||
<div
|
||||
class="mx_EventTileBubble mx_cryptoEvent mx_cryptoEvent_icon_warning"
|
||||
class="mx_EventTileBubble mx_cryptoEvent"
|
||||
>
|
||||
<svg
|
||||
color="var(--cpd-color-icon-critical-primary)"
|
||||
fill="currentColor"
|
||||
height="1em"
|
||||
viewBox="0 0 24 24"
|
||||
width="1em"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
d="M12 17q.424 0 .713-.288A.97.97 0 0 0 13 16a.97.97 0 0 0-.287-.713A.97.97 0 0 0 12 15a.97.97 0 0 0-.713.287A.97.97 0 0 0 11 16q0 .424.287.712.288.288.713.288m0-4q.424 0 .713-.287A.97.97 0 0 0 13 12V8a.97.97 0 0 0-.287-.713A.97.97 0 0 0 12 7a.97.97 0 0 0-.713.287A.97.97 0 0 0 11 8v4q0 .424.287.713.288.287.713.287m0 9a9.7 9.7 0 0 1-3.9-.788 10.1 10.1 0 0 1-3.175-2.137q-1.35-1.35-2.137-3.175A9.7 9.7 0 0 1 2 12q0-2.075.788-3.9a10.1 10.1 0 0 1 2.137-3.175q1.35-1.35 3.175-2.137A9.7 9.7 0 0 1 12 2q2.075 0 3.9.788a10.1 10.1 0 0 1 3.175 2.137q1.35 1.35 2.137 3.175A9.7 9.7 0 0 1 22 12a9.7 9.7 0 0 1-.788 3.9 10.1 10.1 0 0 1-2.137 3.175q-1.35 1.35-3.175 2.137A9.7 9.7 0 0 1 12 22"
|
||||
/>
|
||||
</svg>
|
||||
<div
|
||||
class="mx_EventTileBubble_title"
|
||||
>
|
||||
@ -676,6 +700,17 @@ exports[`RoomView for a local room in state NEW that is encrypted should match t
|
||||
<div
|
||||
class="mx_EventTileBubble mx_cryptoEvent mx_cryptoEvent_icon"
|
||||
>
|
||||
<svg
|
||||
fill="currentColor"
|
||||
height="1em"
|
||||
viewBox="0 0 24 24"
|
||||
width="1em"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
d="M6 22q-.824 0-1.412-.587A1.93 1.93 0 0 1 4 20V10q0-.825.588-1.412A1.93 1.93 0 0 1 6 8h1V6q0-2.075 1.463-3.537Q9.926 1 12 1q2.075 0 3.537 1.463Q17 3.925 17 6v2h1q.824 0 1.413.588Q20 9.175 20 10v10q0 .824-.587 1.413A1.93 1.93 0 0 1 18 22zM9 8h6V6q0-1.25-.875-2.125A2.9 2.9 0 0 0 12 3q-1.25 0-2.125.875A2.9 2.9 0 0 0 9 6z"
|
||||
/>
|
||||
</svg>
|
||||
<div
|
||||
class="mx_EventTileBubble_title"
|
||||
>
|
||||
@ -2974,7 +3009,7 @@ exports[`RoomView should not display the timeline when the room encryption is lo
|
||||
style="width: 12px; height: 12px;"
|
||||
>
|
||||
<svg
|
||||
class="mx_E2EIcon_verified"
|
||||
color="var(--cpd-color-icon-success-primary)"
|
||||
fill="currentColor"
|
||||
height="1em"
|
||||
viewBox="0 0 24 24"
|
||||
|
||||
@ -27,7 +27,7 @@ exports[`<UntrustedDeviceDialog /> should display the dialog for the device of a
|
||||
style="width: 24px; height: 24px;"
|
||||
>
|
||||
<svg
|
||||
class="mx_E2EIcon_warning"
|
||||
color="var(--cpd-color-icon-critical-primary)"
|
||||
fill="currentColor"
|
||||
height="1em"
|
||||
viewBox="0 0 24 24"
|
||||
@ -116,7 +116,7 @@ exports[`<UntrustedDeviceDialog /> should display the dialog for the device of t
|
||||
style="width: 24px; height: 24px;"
|
||||
>
|
||||
<svg
|
||||
class="mx_E2EIcon_warning"
|
||||
color="var(--cpd-color-icon-critical-primary)"
|
||||
fill="currentColor"
|
||||
height="1em"
|
||||
viewBox="0 0 24 24"
|
||||
|
||||
@ -37,7 +37,7 @@ exports[`VerificationRequestDialog After scanning QR, shows confirmation dialog
|
||||
style="width: 128px; height: 128px;"
|
||||
>
|
||||
<svg
|
||||
class="mx_E2EIcon_verified"
|
||||
color="var(--cpd-color-icon-success-primary)"
|
||||
fill="currentColor"
|
||||
height="1em"
|
||||
viewBox="0 0 24 24"
|
||||
@ -313,7 +313,7 @@ exports[`VerificationRequestDialog Shows a successful message if verification fi
|
||||
style="width: 128px; height: 128px;"
|
||||
>
|
||||
<svg
|
||||
class="mx_E2EIcon_verified"
|
||||
color="var(--cpd-color-icon-success-primary)"
|
||||
fill="currentColor"
|
||||
height="1em"
|
||||
viewBox="0 0 24 24"
|
||||
|
||||
@ -73,7 +73,7 @@ exports[`<Users /> should render a single device - signed by owner 1`] = `
|
||||
data-testid="e2e-icon"
|
||||
>
|
||||
<svg
|
||||
class="mx_E2EIcon_normal"
|
||||
color="var(--cpd-color-icon-tertiary)"
|
||||
fill="currentColor"
|
||||
height="1em"
|
||||
viewBox="0 0 24 24"
|
||||
@ -237,7 +237,7 @@ exports[`<Users /> should render a single device - unsigned 1`] = `
|
||||
data-testid="e2e-icon"
|
||||
>
|
||||
<svg
|
||||
class="mx_E2EIcon_warning"
|
||||
color="var(--cpd-color-icon-critical-primary)"
|
||||
fill="currentColor"
|
||||
height="1em"
|
||||
viewBox="0 0 24 24"
|
||||
@ -401,7 +401,7 @@ exports[`<Users /> should render a single device - verified by cross-signing 1`]
|
||||
data-testid="e2e-icon"
|
||||
>
|
||||
<svg
|
||||
class="mx_E2EIcon_verified"
|
||||
color="var(--cpd-color-icon-success-primary)"
|
||||
fill="currentColor"
|
||||
height="1em"
|
||||
viewBox="0 0 24 24"
|
||||
@ -555,7 +555,7 @@ exports[`<Users /> should render a single user 1`] = `
|
||||
data-testid="e2e-icon"
|
||||
>
|
||||
<svg
|
||||
class="mx_E2EIcon_verified"
|
||||
color="var(--cpd-color-icon-success-primary)"
|
||||
fill="currentColor"
|
||||
height="1em"
|
||||
viewBox="0 0 24 24"
|
||||
@ -587,7 +587,7 @@ exports[`<Users /> should render a single user 1`] = `
|
||||
data-testid="e2e-icon"
|
||||
>
|
||||
<svg
|
||||
class="mx_E2EIcon_verified"
|
||||
color="var(--cpd-color-icon-success-primary)"
|
||||
fill="currentColor"
|
||||
height="1em"
|
||||
viewBox="0 0 24 24"
|
||||
@ -613,7 +613,7 @@ exports[`<Users /> should render a single user 1`] = `
|
||||
data-testid="e2e-icon"
|
||||
>
|
||||
<svg
|
||||
class="mx_E2EIcon_normal"
|
||||
color="var(--cpd-color-icon-tertiary)"
|
||||
fill="currentColor"
|
||||
height="1em"
|
||||
viewBox="0 0 24 24"
|
||||
@ -637,7 +637,7 @@ exports[`<Users /> should render a single user 1`] = `
|
||||
data-testid="e2e-icon"
|
||||
>
|
||||
<svg
|
||||
class="mx_E2EIcon_warning"
|
||||
color="var(--cpd-color-icon-critical-primary)"
|
||||
fill="currentColor"
|
||||
height="1em"
|
||||
viewBox="0 0 24 24"
|
||||
|
||||
@ -28,7 +28,19 @@ exports[`AppTile destroys non-persisted right panel widget on room change 1`] =
|
||||
class="mx_AccessibleButton mx_BaseCard_header_title_button--option"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
/>
|
||||
>
|
||||
<svg
|
||||
fill="currentColor"
|
||||
height="1em"
|
||||
viewBox="0 0 24 24"
|
||||
width="1em"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
d="M6 14q-.824 0-1.412-.588A1.93 1.93 0 0 1 4 12q0-.825.588-1.412A1.93 1.93 0 0 1 6 10q.824 0 1.412.588Q8 11.175 8 12t-.588 1.412A1.93 1.93 0 0 1 6 14m6 0q-.825 0-1.412-.588A1.93 1.93 0 0 1 10 12q0-.825.588-1.412A1.93 1.93 0 0 1 12 10q.825 0 1.412.588Q14 11.175 14 12t-.588 1.412A1.93 1.93 0 0 1 12 14m6 0q-.824 0-1.413-.588A1.93 1.93 0 0 1 16 12q0-.825.587-1.412A1.93 1.93 0 0 1 18 10q.824 0 1.413.588Q20 11.175 20 12t-.587 1.412A1.93 1.93 0 0 1 18 14"
|
||||
/>
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
<button
|
||||
aria-labelledby="_r_0_"
|
||||
|
||||
@ -172,7 +172,19 @@ exports[`<MImageBody/> should render MFileBody for svg with no thumbnail 1`] = `
|
||||
>
|
||||
<span
|
||||
class="mx_MFileBody_info_icon"
|
||||
/>
|
||||
>
|
||||
<svg
|
||||
fill="currentColor"
|
||||
height="1em"
|
||||
viewBox="0 0 24 24"
|
||||
width="1em"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
d="M11.5 22q-2.3 0-3.9-1.6T6 16.5V6q0-1.65 1.175-2.825T10 2t2.825 1.175T14 6v9.5q0 1.05-.725 1.775T11.5 18t-1.775-.725T9 15.5V6.75A.73.73 0 0 1 9.75 6a.73.73 0 0 1 .75.75v8.75q0 .424.287.712.288.288.713.288.424 0 .713-.288a.97.97 0 0 0 .287-.712V6q0-1.05-.725-1.775T10 3.5t-1.775.725T7.5 6v10.5q0 1.65 1.175 2.825T11.5 20.5t2.825-1.175T15.5 16.5V6.75a.73.73 0 0 1 .75-.75.73.73 0 0 1 .75.75v9.75q0 2.3-1.6 3.9T11.5 22"
|
||||
/>
|
||||
</svg>
|
||||
</span>
|
||||
<span
|
||||
aria-labelledby="_r_0_"
|
||||
tabindex="0"
|
||||
|
||||
@ -5,6 +5,17 @@ exports[`<RoomPredecessorTile /> Renders as expected 1`] = `
|
||||
<div
|
||||
class="mx_EventTileBubble mx_CreateEvent"
|
||||
>
|
||||
<svg
|
||||
fill="currentColor"
|
||||
height="1em"
|
||||
viewBox="0 0 24 24"
|
||||
width="1em"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
d="M2.95 16.3 1.5 21.25a.94.94 0 0 0 .25 1 .94.94 0 0 0 1 .25l4.95-1.45a10.2 10.2 0 0 0 2.1.712Q10.875 22 12 22a9.7 9.7 0 0 0 3.9-.788 10.1 10.1 0 0 0 3.175-2.137q1.35-1.35 2.137-3.175A9.7 9.7 0 0 0 22 12a9.7 9.7 0 0 0-.788-3.9 10.1 10.1 0 0 0-2.137-3.175q-1.35-1.35-3.175-2.137A9.7 9.7 0 0 0 12 2a9.7 9.7 0 0 0-3.9.788 10.1 10.1 0 0 0-3.175 2.137Q3.575 6.275 2.788 8.1A9.7 9.7 0 0 0 2 12q0 1.125.238 2.2.237 1.076.712 2.1"
|
||||
/>
|
||||
</svg>
|
||||
<div
|
||||
class="mx_EventTileBubble_title"
|
||||
>
|
||||
|
||||
@ -269,8 +269,8 @@ describe("EventTile", () => {
|
||||
|
||||
// there should be a warning shield
|
||||
expect(container.getElementsByClassName("mx_EventTile_e2eIcon")).toHaveLength(1);
|
||||
expect(container.getElementsByClassName("mx_EventTile_e2eIcon")[0].classList).toContain(
|
||||
"mx_EventTile_e2eIcon_warning",
|
||||
expect(container.getElementsByClassName("mx_EventTile_e2eIcon")[0]).toHaveAccessibleName(
|
||||
"Encrypted by a device not verified by its owner.",
|
||||
);
|
||||
});
|
||||
|
||||
@ -298,10 +298,13 @@ describe("EventTile", () => {
|
||||
|
||||
it.each([
|
||||
[EventShieldReason.UNKNOWN, "Unknown error"],
|
||||
[EventShieldReason.UNVERIFIED_IDENTITY, "unverified user"],
|
||||
[EventShieldReason.UNSIGNED_DEVICE, "device not verified by its owner"],
|
||||
[EventShieldReason.UNKNOWN_DEVICE, "unknown or deleted device"],
|
||||
[EventShieldReason.AUTHENTICITY_NOT_GUARANTEED, "can't be guaranteed"],
|
||||
[EventShieldReason.UNVERIFIED_IDENTITY, "Encrypted by an unverified user."],
|
||||
[EventShieldReason.UNSIGNED_DEVICE, "Encrypted by a device not verified by its owner."],
|
||||
[EventShieldReason.UNKNOWN_DEVICE, "Encrypted by an unknown or deleted device."],
|
||||
[
|
||||
EventShieldReason.AUTHENTICITY_NOT_GUARANTEED,
|
||||
"The authenticity of this encrypted message can't be guaranteed on this device.",
|
||||
],
|
||||
[EventShieldReason.MISMATCHED_SENDER_KEY, "Encrypted by an unverified session"],
|
||||
[EventShieldReason.SENT_IN_CLEAR, "Not encrypted"],
|
||||
[EventShieldReason.VERIFICATION_VIOLATION, "Sender's verified identity was reset"],
|
||||
@ -326,12 +329,7 @@ describe("EventTile", () => {
|
||||
|
||||
const e2eIcons = container.getElementsByClassName("mx_EventTile_e2eIcon");
|
||||
expect(e2eIcons).toHaveLength(1);
|
||||
expect(e2eIcons[0].classList).toContain("mx_EventTile_e2eIcon_normal");
|
||||
fireEvent.focus(e2eIcons[0]);
|
||||
expect(e2eIcons[0].getAttribute("aria-labelledby")).toBeTruthy();
|
||||
expect(document.getElementById(e2eIcons[0].getAttribute("aria-labelledby")!)).toHaveTextContent(
|
||||
expectedText,
|
||||
);
|
||||
expect(e2eIcons[0]).toHaveAccessibleName(expectedText);
|
||||
});
|
||||
|
||||
describe("undecryptable event", () => {
|
||||
@ -360,8 +358,8 @@ describe("EventTile", () => {
|
||||
expect(eventTiles).toHaveLength(1);
|
||||
|
||||
expect(container.getElementsByClassName("mx_EventTile_e2eIcon")).toHaveLength(1);
|
||||
expect(container.getElementsByClassName("mx_EventTile_e2eIcon")[0].classList).toContain(
|
||||
"mx_EventTile_e2eIcon_decryption_failure",
|
||||
expect(container.getElementsByClassName("mx_EventTile_e2eIcon")[0]).toHaveAccessibleName(
|
||||
"This message could not be decrypted",
|
||||
);
|
||||
});
|
||||
|
||||
@ -436,8 +434,8 @@ describe("EventTile", () => {
|
||||
|
||||
// check it was updated
|
||||
expect(container.getElementsByClassName("mx_EventTile_e2eIcon")).toHaveLength(1);
|
||||
expect(container.getElementsByClassName("mx_EventTile_e2eIcon")[0].classList).toContain(
|
||||
"mx_EventTile_e2eIcon_warning",
|
||||
expect(container.getElementsByClassName("mx_EventTile_e2eIcon")[0]).toHaveAccessibleName(
|
||||
"Encrypted by a device not verified by its owner.",
|
||||
);
|
||||
});
|
||||
|
||||
@ -481,9 +479,7 @@ describe("EventTile", () => {
|
||||
|
||||
// check it was updated
|
||||
expect(container.getElementsByClassName("mx_EventTile_e2eIcon")).toHaveLength(1);
|
||||
expect(container.getElementsByClassName("mx_EventTile_e2eIcon")[0].classList).toContain(
|
||||
"mx_EventTile_e2eIcon_warning",
|
||||
);
|
||||
expect(container.getElementsByClassName("mx_EventTile_e2eIcon")[0]).toHaveAccessibleName("Not encrypted");
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@ -330,10 +330,10 @@ describe("SendWysiwygComposer", () => {
|
||||
"Left icon when %s",
|
||||
({ isRichTextEnabled }) => {
|
||||
it.each([
|
||||
[E2EStatus.Verified, "mx_E2EIcon_verified"],
|
||||
[E2EStatus.Warning, "mx_E2EIcon_warning"],
|
||||
[E2EStatus.Verified, "Everyone in this room is verified"],
|
||||
[E2EStatus.Warning, "Someone is using an unknown session"],
|
||||
[undefined, undefined],
|
||||
])("Should render left icon when e2eStatus is %s", async (e2eStatus, expectedClass) => {
|
||||
])("Should render left icon when e2eStatus is %s", async (e2eStatus, expectedLabel) => {
|
||||
// When
|
||||
customRender(jest.fn(), jest.fn(), false, isRichTextEnabled, undefined, e2eStatus);
|
||||
await waitFor(() => expect(screen.getByRole("textbox")).toHaveAttribute("contentEditable", "true"));
|
||||
@ -341,9 +341,9 @@ describe("SendWysiwygComposer", () => {
|
||||
// Then
|
||||
expect(leftIcon).toBeInTheDocument();
|
||||
expect(leftIcon).toHaveClass("mx_E2EIcon");
|
||||
if (expectedClass) {
|
||||
if (expectedLabel) {
|
||||
// eslint-disable-next-line jest/no-conditional-expect
|
||||
expect(leftIcon.querySelector("svg")).toHaveClass(expectedClass);
|
||||
expect(leftIcon).toHaveAccessibleName(expectedLabel);
|
||||
} else {
|
||||
// eslint-disable-next-line jest/no-conditional-expect
|
||||
expect(leftIcon.querySelector("svg")).not.toBeInTheDocument();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user