Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[web][contacts] fix async profile picture mocks

Neeraj Gupta5f3c4bccdf26
diff --git a/web/packages/contacts/index.test.ts b/web/packages/contacts/index.test.ts
index 98c9e2ea88..4cd8a9e37e 100644
--- a/web/packages/contacts/index.test.ts
+++ b/web/packages/contacts/index.test.ts
@@ -116,9 +116,11 @@ const setupContactsModule = async (options: SetupOptions = {}) => {
.mockResolvedValueOnce([]);
const get_profile_picture = vi.fn(() => {
if (options.getProfilePictureBytes) {
- return options.getProfilePictureBytes;
+ return Promise.resolve(options.getProfilePictureBytes);
}
- throw options.getProfilePictureError ?? new Error("boom");
+ return Promise.reject(
+ options.getProfilePictureError ?? new Error("boom"),
+ );
});
vi.doMock("ente-base/kv", () => ({ getKV, getKVN, setKV }));