1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-08-09 08:42:50 +03:00

Fix jest/valid-expects lints (#11238)

This commit is contained in:
Michael Telatynski
2023-07-13 16:19:44 +01:00
committed by GitHub
parent d7d60a3255
commit f5f31eb7d8
7 changed files with 27 additions and 26 deletions

View File

@@ -60,9 +60,7 @@ describe("ConfirmRedactDialog", () => {
user: client.getSafeUserId(),
});
jest.spyOn(mxEvent, "getId").mockReturnValue(undefined);
expect(async () => {
await confirmDeleteVoiceBroadcastStartedEvent();
}).rejects.toThrow("cannot redact event without ID");
await expect(confirmDeleteVoiceBroadcastStartedEvent()).rejects.toThrow("cannot redact event without ID");
});
it("should raise an error for an event without room-ID", async () => {
@@ -74,9 +72,9 @@ describe("ConfirmRedactDialog", () => {
user: client.getSafeUserId(),
});
jest.spyOn(mxEvent, "getRoomId").mockReturnValue(undefined);
expect(async () => {
await confirmDeleteVoiceBroadcastStartedEvent();
}).rejects.toThrow(`cannot redact event ${mxEvent.getId()} without room ID`);
await expect(confirmDeleteVoiceBroadcastStartedEvent()).rejects.toThrow(
`cannot redact event ${mxEvent.getId()} without room ID`,
);
});
describe("when redacting a voice broadcast started event", () => {