1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-23 17:02:25 +03:00

fixup testrs

This commit is contained in:
Half-Shot
2025-10-03 14:06:31 +01:00
parent af8c329ebe
commit 42cdbf7cdc
2 changed files with 4 additions and 4 deletions

View File

@@ -241,7 +241,7 @@ describe("MatrixRTCSession", () => {
it("perfers sticky events when both membership and sticky events appear for the same user", () => { it("perfers sticky events when both membership and sticky events appear for the same user", () => {
// Create a room with identical member state and sticky state for the same user. // Create a room with identical member state and sticky state for the same user.
const mockRoom = makeMockRoom([membershipTemplate]); const mockRoom = makeMockRoom([membershipTemplate]);
mockRoom.unstableGetStickyEvents.mockImplementation(() => { mockRoom._unstable_getStickyEvents.mockImplementation(() => {
const ev = mockRTCEvent( const ev = mockRTCEvent(
{ {
...membershipTemplate, ...membershipTemplate,
@@ -269,7 +269,7 @@ describe("MatrixRTCSession", () => {
// Create a room with identical member state and sticky state for the same user. // Create a room with identical member state and sticky state for the same user.
const mockRoom = makeMockRoom([membershipTemplate]); const mockRoom = makeMockRoom([membershipTemplate]);
const otherUserId = "@othermock:user.example"; const otherUserId = "@othermock:user.example";
mockRoom.unstableGetStickyEvents.mockImplementation(() => { mockRoom._unstable_getStickyEvents.mockImplementation(() => {
const ev = mockRTCEvent( const ev = mockRTCEvent(
{ {
...membershipTemplate, ...membershipTemplate,

View File

@@ -88,7 +88,7 @@ export function makeMockRoom(
getState: jest.fn().mockReturnValue(roomState), getState: jest.fn().mockReturnValue(roomState),
}), }),
getVersion: jest.fn().mockReturnValue("default"), getVersion: jest.fn().mockReturnValue("default"),
unstableGetStickyEvents: jest _unstable_getStickyEvents: jest
.fn() .fn()
.mockImplementation(() => .mockImplementation(() =>
useStickyEvents ? membershipData.map((m) => mockRTCEvent(m, roomId, 10000, ts)) : [], useStickyEvents ? membershipData.map((m) => mockRTCEvent(m, roomId, 10000, ts)) : [],
@@ -170,7 +170,7 @@ export function mockRTCEvent(
timestamp, timestamp,
!stickyDuration && "device_id" in membershipData ? `_${sender}_${membershipData.device_id}` : "", !stickyDuration && "device_id" in membershipData ? `_${sender}_${membershipData.device_id}` : "",
), ),
unstableStickyExpiresAt:stickyDuration, unstableStickyExpiresAt: stickyDuration,
} as unknown as MatrixEvent; } as unknown as MatrixEvent;
} }