[Backport staging] Fix regressions around media uploads failing and causing soft crashes (#9550)

(cherry picked from commit 77764d80bc)

Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
ElementRobot
2022-11-07 12:23:47 +00:00
committed by GitHub
parent e58681ee73
commit fe0759803a
6 changed files with 17 additions and 218 deletions

View File

@@ -232,6 +232,15 @@ describe("Notifier", () => {
});
});
describe("getSoundForRoom", () => {
it("should not explode if given invalid url", () => {
jest.spyOn(SettingsStore, "getValue").mockImplementation((name: string) => {
return { url: { content_uri: "foobar" } };
});
expect(Notifier.getSoundForRoom("!roomId:server")).toBeNull();
});
});
describe("_playAudioNotification", () => {
it.each([
{ event: { is_silenced: true }, count: 0 },