InviteDialog: remove broken checks for unknown users (#33026)
* InviteDialog: remove broken checks for unknown users Per https://github.com/element-hq/element-web/issues/33020, this doesn't actually work, and if we were to bring it back, we'd design it differently. * Remove now-unused `UserProfilesStore.getProfileLookupError` This was only used in `InviteDialog.checkProfileAndStartDm`, which has now been removed.
This commit is contained in:
@@ -86,11 +86,6 @@ describe("UserProfilesStore", () => {
|
||||
expect(profile).toBeNull();
|
||||
});
|
||||
|
||||
it("should cache the error and result", () => {
|
||||
expect(userProfilesStore.getProfile(userIdDoesNotExist)).toBeNull();
|
||||
expect(userProfilesStore.getProfileLookupError(userIdDoesNotExist)).toBe(userDoesNotExistError);
|
||||
});
|
||||
|
||||
describe("when the profile does not exist and fetching it again", () => {
|
||||
beforeEach(async () => {
|
||||
mockClient.getProfileInfo.mockResolvedValue(user1Profile);
|
||||
@@ -100,10 +95,6 @@ describe("UserProfilesStore", () => {
|
||||
it("should return the profile", () => {
|
||||
expect(profile).toBe(user1Profile);
|
||||
});
|
||||
|
||||
it("should clear the error", () => {
|
||||
expect(userProfilesStore.getProfileLookupError(userIdDoesNotExist)).toBeUndefined();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -119,22 +110,6 @@ describe("UserProfilesStore", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("getProfileLookupError", () => {
|
||||
it("should return undefined if a profile was not fetched", () => {
|
||||
expect(userProfilesStore.getProfileLookupError(user1Id)).toBeUndefined();
|
||||
});
|
||||
|
||||
it("should return undefined if a profile was successfully fetched", async () => {
|
||||
await userProfilesStore.fetchProfile(user1Id);
|
||||
expect(userProfilesStore.getProfileLookupError(user1Id)).toBeUndefined();
|
||||
});
|
||||
|
||||
it("should return the error if there was one", async () => {
|
||||
await userProfilesStore.fetchProfile(userIdDoesNotExist);
|
||||
expect(userProfilesStore.getProfileLookupError(userIdDoesNotExist)).toBe(userDoesNotExistError);
|
||||
});
|
||||
});
|
||||
|
||||
it("getOnlyKnownProfile should return undefined if the profile was not fetched", () => {
|
||||
expect(userProfilesStore.getOnlyKnownProfile(user1Id)).toBeUndefined();
|
||||
});
|
||||
@@ -195,7 +170,6 @@ describe("UserProfilesStore", () => {
|
||||
|
||||
expect(userProfilesStore.getProfile(user1Id)).toBeUndefined();
|
||||
expect(userProfilesStore.getOnlyKnownProfile(user1Id)).toBeUndefined();
|
||||
expect(userProfilesStore.getProfileLookupError(userIdDoesNotExist)).toBeUndefined();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user