From 88e5a5badb1ecdf43d06e1521edd6a34921b325b Mon Sep 17 00:00:00 2001 From: "Timo K." Date: Mon, 10 Aug 2026 14:21:49 +0200 Subject: [PATCH] More resolution tests. --- src/livekit/options.test.ts | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/src/livekit/options.test.ts b/src/livekit/options.test.ts index e48bcad4f..cea3d9132 100644 --- a/src/livekit/options.test.ts +++ b/src/livekit/options.test.ts @@ -46,17 +46,30 @@ describe("buildLiveKitOptions", () => { }); it("applies video resolution and encoding from config", () => { - const opts = buildLiveKitOptions({ - video: { - max_resolution: 1080, - max_bitrate: 3_000_000, - max_framerate: 60, - }, + const baseVideoConfig = { + max_resolution: 1080, + max_bitrate: 3_000_000, + max_framerate: 60, + }; + const opts1080 = buildLiveKitOptions({ + video: baseVideoConfig, }); - expect(opts.videoCaptureDefaults?.resolution).toEqual( + const opts1440 = buildLiveKitOptions({ + video: { ...baseVideoConfig, max_resolution: 1440 }, + }); + const opts2160 = buildLiveKitOptions({ + video: { ...baseVideoConfig, max_resolution: 2160 }, + }); + expect(opts1080.videoCaptureDefaults?.resolution).toEqual( VideoPresets.h1080.resolution, ); - expect(opts.publishDefaults?.videoEncoding).toEqual({ + expect(opts1440.videoCaptureDefaults?.resolution).toEqual( + VideoPresets.h1440.resolution, + ); + expect(opts2160.videoCaptureDefaults?.resolution).toEqual( + VideoPresets.h2160.resolution, + ); + expect(opts1080.publishDefaults?.videoEncoding).toEqual({ maxBitrate: 3_000_000, maxFramerate: 60, });