From ed3d168ac381d623d7c8dc00d57cb16aff8a1e35 Mon Sep 17 00:00:00 2001 From: Timo K Date: Fri, 9 Jan 2026 17:29:48 +0100 Subject: [PATCH] fix tests --- src/settings/DeveloperSettingsTab.test.tsx | 6 +- .../DeveloperSettingsTab.test.tsx.snap | 96 ++++++++++++------- .../localMember/LocalMember.test.ts | 14 ++- .../localMember/LocalTransport.test.ts | 84 ++++++++++++---- .../remoteMembers/ConnectionManager.test.ts | 4 +- 5 files changed, 146 insertions(+), 58 deletions(-) diff --git a/src/settings/DeveloperSettingsTab.test.tsx b/src/settings/DeveloperSettingsTab.test.tsx index c18cf23b..23fa67a7 100644 --- a/src/settings/DeveloperSettingsTab.test.tsx +++ b/src/settings/DeveloperSettingsTab.test.tsx @@ -7,9 +7,9 @@ Please see LICENSE in the repository root for full details. import { describe, expect, it, vi } from "vitest"; import { render, waitFor } from "@testing-library/react"; +import { type Room as LivekitRoom } from "livekit-client"; import type { MatrixClient } from "matrix-js-sdk"; -import type { Room as LivekitRoom } from "livekit-client"; import { DeveloperSettingsTab } from "./DeveloperSettingsTab"; // Mock url params hook to avoid environment-dependent snapshot churn. @@ -30,6 +30,8 @@ function createMockLivekitRoom( serverInfo, metadata, engine: { client: { ws: { url: wsUrl } } }, + localParticipant: { identity: "localParticipantIdentity" }, + remoteParticipants: new Map(), } as unknown as LivekitRoom; return { @@ -69,6 +71,8 @@ describe("DeveloperSettingsTab", () => { isLocal: false, url: "wss://remote-sfu.example.org", room: { + localParticipant: { identity: "localParticipantIdentity" }, + remoteParticipants: new Map(), serverInfo: { region: "remote", version: "4.5.6" }, metadata: "remote-metadata", engine: { client: { ws: { url: "wss://remote-sfu.example.org" } } }, diff --git a/src/settings/__snapshots__/DeveloperSettingsTab.test.tsx.snap b/src/settings/__snapshots__/DeveloperSettingsTab.test.tsx.snap index 1c82d07b..cb17bcc5 100644 --- a/src/settings/__snapshots__/DeveloperSettingsTab.test.tsx.snap +++ b/src/settings/__snapshots__/DeveloperSettingsTab.test.tsx.snap @@ -349,46 +349,78 @@ exports[`DeveloperSettingsTab > renders and matches snapshot 1`] = ` -

- LiveKit SFU: wss://local-sfu.example.org -

-

- ws-url: - wss://local-sfu.example.org/ -

-

- LiveKit Server Info - ( - local - ) -

-
-    {
+    

+ LiveKit SFU: wss://local-sfu.example.org +

+

+ ws-url: + wss://local-sfu.example.org/ +

+

+ LiveKit Server Info + ( + local + ) +

+
+      {
   "region": "local",
   "version": "1.2.3"
 }
-    local-metadata
-  
-

- LiveKit SFU: wss://remote-sfu.example.org -

-

- LiveKit Server Info - ( - remote - ) -

-
+    

+ Local Participant +

+
+      localParticipantIdentity
+    
+

+ Remote Participants +

+
    + +
    - { +

    + LiveKit SFU: wss://remote-sfu.example.org +

    +

    + LiveKit Server Info + ( + remote + ) +

    +
    +      {
       "region": "remote",
       "version": "4.5.6"
     }
    -    remote-metadata
    -  
    + remote-metadata +
+

+ Local Participant +

+
+      localParticipantIdentity
+    
+

+ Remote Participants +

+