Skip to content

Commit 7f2fab6

Browse files
committed
Remove redundant UserIdentityWarning test
Since the refactoring in #29067, this test is redundant. It is also flaky and hard to understand. Time for it to die.
1 parent dfd08a8 commit 7f2fab6

1 file changed

Lines changed: 0 additions & 45 deletions

File tree

test/unit-tests/components/views/rooms/UserIdentityWarning-test.tsx

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -579,49 +579,4 @@ describe("UserIdentityWarning", () => {
579579
expect(getWarningByText("@bob:example.org's identity appears to have changed.")).toBeInTheDocument(),
580580
);
581581
});
582-
583-
// If we get an update for a user's verification status while we're fetching
584-
// that user's verification status, we should display based on the updated
585-
// value.
586-
describe("handles races between fetching verification status and receiving updates", () => {
587-
// First case: check that if the update says that the user identity
588-
// needs approval, but the fetch says it doesn't, we show the warning.
589-
it("update says identity needs approval", async () => {
590-
jest.spyOn(room, "getEncryptionTargetMembers").mockResolvedValue([
591-
mockRoomMember("@alice:example.org", "Alice"),
592-
]);
593-
jest.spyOn(room, "getMember").mockReturnValue(mockRoomMember("@alice:example.org", "Alice"));
594-
const crypto = client.getCrypto()!;
595-
596-
const firstStatusPromise = defer();
597-
let callNumber = 0;
598-
jest.spyOn(crypto, "getUserVerificationStatus").mockImplementation(async () => {
599-
await firstStatusPromise.promise;
600-
callNumber++;
601-
if (callNumber == 1) {
602-
await sleep(40);
603-
return new UserVerificationStatus(false, false, false, false);
604-
} else {
605-
return new UserVerificationStatus(false, false, false, true);
606-
}
607-
});
608-
609-
renderComponent(client, room);
610-
await sleep(10); // give it some time to finish initialising
611-
612-
act(() => {
613-
client.emit(
614-
CryptoEvent.UserTrustStatusChanged,
615-
"@alice:example.org",
616-
new UserVerificationStatus(false, false, false, true),
617-
);
618-
firstStatusPromise.resolve(undefined);
619-
});
620-
await waitFor(() =>
621-
expect(
622-
getWarningByText("Alice's (@alice:example.org) identity appears to have changed."),
623-
).toBeInTheDocument(),
624-
);
625-
});
626-
});
627582
});

0 commit comments

Comments
 (0)