Refactor stores and their relationship to the MatrixClientPeg (#124)

* Refactor stores and their relationship to the MatrixClientPeg

to avoid import cycles and webpack weirdness

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Iterate

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

---------

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski 2024-10-08 10:12:21 +01:00 committed by GitHub
parent 31bd10e887
commit 197168b3ba
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
28 changed files with 71 additions and 66 deletions

View file

@ -40,7 +40,7 @@ describe("OwnProfileStore", () => {
displayname: "Display Name",
avatar_url: "mxc://example.com/abc123",
});
await ownProfileStore.start();
await ownProfileStore.useUnitTestClient(client);
expect(onUpdate).toHaveBeenCalled();
expect(ownProfileStore.displayName).toBe("Display Name");
@ -54,7 +54,7 @@ describe("OwnProfileStore", () => {
errcode: "M_NOT_FOUND",
}),
);
await ownProfileStore.start();
await ownProfileStore.useUnitTestClient(client);
expect(onUpdate).toHaveBeenCalled();
expect(ownProfileStore.displayName).toBe(client.getSafeUserId());
@ -69,7 +69,7 @@ describe("OwnProfileStore", () => {
}),
);
try {
await ownProfileStore.start();
await ownProfileStore.useUnitTestClient(client);
} catch (ignore) {}
expect(onUpdate).not.toHaveBeenCalled();