Localazy Download (#32808)

* [create-pull-request] automated change

* test: update SC tests

* test: update SC screenshots

* test: update EW snapshots

* test: update EW tests

* test: update EW e2e tests

---------

Co-authored-by: t3chguy <2403652+t3chguy@users.noreply.github.com>
Co-authored-by: Florian Duros <florian.duros@ormaz.fr>
This commit is contained in:
ElementRobot
2026-03-18 15:53:28 +00:00
committed by GitHub
co-authored by t3chguy Florian Duros
parent 2128c1884c
commit 8a38a2fe4a
105 changed files with 535 additions and 836 deletions
@@ -309,7 +309,7 @@ describe("EventTile", () => {
],
[EventShieldReason.MISMATCHED_SENDER_KEY, "Encrypted by an unverified session"],
[EventShieldReason.SENT_IN_CLEAR, "Not encrypted"],
[EventShieldReason.VERIFICATION_VIOLATION, "Sender's verified identity was reset"],
[EventShieldReason.VERIFICATION_VIOLATION, "Sender's verified digital identity was reset"],
[
EventShieldReason.MISMATCHED_SENDER,
"The sender of the event does not match the owner of the device that sent it.",
@@ -145,7 +145,7 @@ describe("UserIdentityWarning", () => {
renderComponent(client, room);
await waitFor(() =>
expect(getWarningByText("Alice's (@alice:example.org) identity was reset.")).toBeInTheDocument(),
expect(getWarningByText("Alice's (@alice:example.org) digital identity was reset.")).toBeInTheDocument(),
);
await userEvent.click(screen.getByRole("button")!);
await waitFor(() => expect(crypto.pinCurrentUserIdentity).toHaveBeenCalledWith("@alice:example.org"));
@@ -166,7 +166,7 @@ describe("UserIdentityWarning", () => {
renderComponent(client, room);
await waitFor(() =>
expect(getWarningByText("Alice's (@alice:example.org) identity was reset.")).toBeInTheDocument(),
expect(getWarningByText("Alice's (@alice:example.org) digital identity was reset.")).toBeInTheDocument(),
);
expect(
@@ -190,7 +190,7 @@ describe("UserIdentityWarning", () => {
renderComponent(client, room);
await sleep(10); // give it some time to finish initialising
expect(() => getWarningByText("Alice's (@alice:example.org) identity was reset.")).toThrow();
expect(() => getWarningByText("Alice's (@alice:example.org) digital identity was reset.")).toThrow();
});
// We don't display warnings in non-encrypted rooms, but if encryption is
@@ -210,7 +210,7 @@ describe("UserIdentityWarning", () => {
renderComponent(client, room);
await sleep(10); // give it some time to finish initialising
expect(() => getWarningByText("Alice's (@alice:example.org) identity was reset.")).toThrow();
expect(() => getWarningByText("Alice's (@alice:example.org) digital identity was reset.")).toThrow();
// Encryption gets enabled in the room. We should now warn that Alice's
// identity changed.
@@ -231,7 +231,7 @@ describe("UserIdentityWarning", () => {
null,
);
await waitFor(() =>
expect(getWarningByText("Alice's (@alice:example.org) identity was reset.")).toBeInTheDocument(),
expect(getWarningByText("Alice's (@alice:example.org) digital identity was reset.")).toBeInTheDocument(),
);
});
@@ -250,7 +250,9 @@ describe("UserIdentityWarning", () => {
crypto.pinCurrentUserIdentity = jest.fn();
renderComponent(client, room);
await waitFor(() => expect(getWarningByText("@a:example.org's identity was reset.")).toBeInTheDocument());
await waitFor(() =>
expect(getWarningByText("@a:example.org's digital identity was reset.")).toBeInTheDocument(),
);
});
it("Ensure existing prompt stays even if a new violation with lower lexicographic order detected", async () => {
@@ -266,7 +268,9 @@ describe("UserIdentityWarning", () => {
crypto.pinCurrentUserIdentity = jest.fn();
renderComponent(client, room);
await waitFor(() => expect(getWarningByText("@b:example.org's identity was reset.")).toBeInTheDocument());
await waitFor(() =>
expect(getWarningByText("@b:example.org's digital identity was reset.")).toBeInTheDocument(),
);
// Simulate a new member joined with lower lexico order and also in violation
mockMembershipForRoom(room, ["@a:example.org", "@b:example.org"]);
@@ -276,7 +280,9 @@ describe("UserIdentityWarning", () => {
});
// We should still display the warning for @b:example.org
await waitFor(() => expect(getWarningByText("@b:example.org's identity was reset.")).toBeInTheDocument());
await waitFor(() =>
expect(getWarningByText("@b:example.org's digital identity was reset.")).toBeInTheDocument(),
);
});
});
@@ -296,7 +302,7 @@ describe("UserIdentityWarning", () => {
await sleep(50);
});
expect(() => getWarningByText("Alice's (@alice:example.org) identity was reset.")).toThrow();
expect(() => getWarningByText("Alice's (@alice:example.org) digital identity was reset.")).toThrow();
// The user changes their identity, so we should show the warning.
act(() => {
@@ -306,7 +312,7 @@ describe("UserIdentityWarning", () => {
});
await waitFor(() =>
expect(getWarningByText("Alice's (@alice:example.org) identity was reset.")).toBeInTheDocument(),
expect(getWarningByText("Alice's (@alice:example.org) digital identity was reset.")).toBeInTheDocument(),
);
// Simulate the user's new identity having been approved, so we no
@@ -317,7 +323,7 @@ describe("UserIdentityWarning", () => {
client.emit(CryptoEvent.UserTrustStatusChanged, "@alice:example.org", newStatus);
});
await waitFor(() =>
expect(() => getWarningByText("Alice's (@alice:example.org) identity was reset.")).toThrow(),
expect(() => getWarningByText("Alice's (@alice:example.org) digital identity was reset.")).toThrow(),
);
});
@@ -342,7 +348,7 @@ describe("UserIdentityWarning", () => {
});
await waitFor(() =>
expect(getWarningByText("@alice:example.org's identity was reset.")).toBeInTheDocument(),
expect(getWarningByText("@alice:example.org's digital identity was reset.")).toBeInTheDocument(),
);
// Bob is invited. His identity needs approval, so we should show a
@@ -359,8 +365,12 @@ describe("UserIdentityWarning", () => {
emitMembershipChange(client, "@alice:example.org", "leave");
});
await waitFor(() => expect(() => getWarningByText("@alice:example.org's identity was reset.")).toThrow());
await waitFor(() => expect(getWarningByText("@bob:example.org's identity was reset.")).toBeInTheDocument());
await waitFor(() =>
expect(() => getWarningByText("@alice:example.org's digital identity was reset.")).toThrow(),
);
await waitFor(() =>
expect(getWarningByText("@bob:example.org's digital identity was reset.")).toBeInTheDocument(),
);
});
it("when invited users cannot see encrypted messages", async () => {
@@ -382,7 +392,7 @@ describe("UserIdentityWarning", () => {
emitMembershipChange(client, "@alice:example.org", "join");
});
await waitFor(() =>
expect(getWarningByText("@alice:example.org's identity was reset.")).toBeInTheDocument(),
expect(getWarningByText("@alice:example.org's digital identity was reset.")).toBeInTheDocument(),
);
// Bob is invited. His identity needs approval, but we don't encrypt
@@ -402,8 +412,12 @@ describe("UserIdentityWarning", () => {
mockMembershipForRoom(room, [["@bob:example.org", "invited"]]);
emitMembershipChange(client, "@alice:example.org", "leave");
});
await waitFor(() => expect(() => getWarningByText("@alice:example.org's identity was reset.")).toThrow());
await waitFor(() => expect(() => getWarningByText("@bob:example.org's identity was reset.")).toThrow());
await waitFor(() =>
expect(() => getWarningByText("@alice:example.org's digital identity was reset.")).toThrow(),
);
await waitFor(() =>
expect(() => getWarningByText("@bob:example.org's digital identity was reset.")).toThrow(),
);
});
it("when member leaves immediately after component is loaded", async () => {
@@ -427,7 +441,7 @@ describe("UserIdentityWarning", () => {
renderComponent(client, room);
await sleep(10);
});
expect(() => getWarningByText("@alice:example.org's identity was reset.")).toThrow();
expect(() => getWarningByText("@alice:example.org's digital identity was reset.")).toThrow();
});
it("when member leaves immediately after joining", async () => {
@@ -475,7 +489,7 @@ describe("UserIdentityWarning", () => {
null,
);
await sleep(10); // give it some time to finish
expect(() => getWarningByText("@alice:example.org's identity was reset.")).toThrow();
expect(() => getWarningByText("@alice:example.org's digital identity was reset.")).toThrow();
});
});
@@ -495,7 +509,7 @@ describe("UserIdentityWarning", () => {
renderComponent(client, room);
// We should warn about Alice's identity first.
await waitFor(() =>
expect(getWarningByText("Alice's (@alice:example.org) identity was reset.")).toBeInTheDocument(),
expect(getWarningByText("Alice's (@alice:example.org) digital identity was reset.")).toBeInTheDocument(),
);
// Simulate Alice's new identity having been approved, so now we warn
@@ -511,7 +525,9 @@ describe("UserIdentityWarning", () => {
});
client.emit(CryptoEvent.UserTrustStatusChanged, "@alice:example.org", newStatus);
});
await waitFor(() => expect(getWarningByText("@bob:example.org's identity was reset.")).toBeInTheDocument());
await waitFor(() =>
expect(getWarningByText("@bob:example.org's digital identity was reset.")).toBeInTheDocument(),
);
});
it("displays the next user when the verification requirement is withdrawn", async () => {
@@ -531,7 +547,7 @@ describe("UserIdentityWarning", () => {
renderComponent(client, room);
// We should warn about Alice's identity first.
await waitFor(() =>
expect(getWarningByText("Alice's (@alice:example.org) identity was reset.")).toBeInTheDocument(),
expect(getWarningByText("Alice's (@alice:example.org) digital identity was reset.")).toBeInTheDocument(),
);
// Simulate Alice's new identity having been approved, so now we warn
@@ -550,6 +566,8 @@ describe("UserIdentityWarning", () => {
new UserVerificationStatus(false, false, false, false),
);
});
await waitFor(() => expect(getWarningByText("@bob:example.org's identity was reset.")).toBeInTheDocument());
await waitFor(() =>
expect(getWarningByText("@bob:example.org's digital identity was reset.")).toBeInTheDocument(),
);
});
});