Avoid using deprecated exports & methods from matrix-js-sdk (#12359)

This commit is contained in:
Michael Telatynski 2024-03-25 12:21:02 +00:00 committed by GitHub
parent 11912a0da0
commit 4941327c78
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
24 changed files with 73 additions and 80 deletions

View file

@ -73,7 +73,10 @@ describe("EventUtils", () => {
type: EventType.RoomMessage,
sender: userId,
});
redactedEvent.makeRedacted(redactedEvent);
redactedEvent.makeRedacted(
redactedEvent,
new Room(redactedEvent.getRoomId()!, mockClient, mockClient.getUserId()!),
);
const stateEvent = new MatrixEvent({
type: EventType.RoomTopic,

View file

@ -14,10 +14,10 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { EventType, MatrixEvent } from "matrix-js-sdk/src/matrix";
import { EventType, MatrixEvent, Room } from "matrix-js-sdk/src/matrix";
import { shouldDisplayAsBeaconTile } from "../../../src/utils/beacon/timeline";
import { makeBeaconInfoEvent } from "../../test-utils";
import { makeBeaconInfoEvent, stubClient } from "../../test-utils";
describe("shouldDisplayAsBeaconTile", () => {
const userId = "@user:server";
@ -26,7 +26,7 @@ describe("shouldDisplayAsBeaconTile", () => {
const notLiveBeacon = makeBeaconInfoEvent(userId, roomId, { isLive: false });
const memberEvent = new MatrixEvent({ type: EventType.RoomMember });
const redactedBeacon = makeBeaconInfoEvent(userId, roomId, { isLive: false });
redactedBeacon.makeRedacted(redactedBeacon);
redactedBeacon.makeRedacted(redactedBeacon, new Room(roomId, stubClient(), userId));
it("returns true for a beacon with live property set to true", () => {
expect(shouldDisplayAsBeaconTile(liveBeacon)).toBe(true);