From c9b6c7fc2f176d87b03ba160b7fce721f7a6c293 Mon Sep 17 00:00:00 2001 From: Half-Shot Date: Tue, 5 Nov 2024 18:34:04 +0000 Subject: [PATCH] type tidyups --- src/utils/testReactions.tsx | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/utils/testReactions.tsx b/src/utils/testReactions.tsx index 3390cad0..8efbce41 100644 --- a/src/utils/testReactions.tsx +++ b/src/utils/testReactions.tsx @@ -1,5 +1,11 @@ +/* +Copyright 2024 New Vector Ltd. + +SPDX-License-Identifier: AGPL-3.0-only +Please see LICENSE in the repository root for full details. +*/ + import { PropsWithChildren, ReactNode } from "react"; -import { ReactionsProvider } from "../useReactions"; import { randomUUID } from "crypto"; import EventEmitter from "events"; import { MatrixClient } from "matrix-js-sdk/src/client"; @@ -15,6 +21,8 @@ import { MatrixRTCSessionEvent, } from "matrix-js-sdk/src/matrixrtc"; +import { ReactionsProvider } from "../useReactions"; + export const TestReactionsWrapper = ({ rtcSession, children, @@ -99,7 +107,9 @@ export function createRedaction( export class MockRoom extends EventEmitter { public readonly testSentEvents: Parameters[] = []; - public readonly testRedactedEvents: Parameters[] = []; + public readonly testRedactedEvents: Parameters< + MatrixClient["redactEvent"] + >[] = []; public constructor( private readonly ownUserId: string, @@ -115,13 +125,13 @@ export class MockRoom extends EventEmitter { ...props: Parameters ): ReturnType => { this.testSentEvents.push(props); - return { event_id: randomUUID() }; + return Promise.resolve({ event_id: randomUUID() }); }, redactEvent: async ( ...props: Parameters ): ReturnType => { this.testRedactedEvents.push(props); - return { event_id: randomUUID() }; + return Promise.resolve({ event_id: randomUUID() }); }, } as unknown as MatrixClient; }